แก้ไข

แชร์ผ่าน


LogStore Constructors

Definition

Initializes a new instance of the LogStore class.

Overloads

LogStore(SafeFileHandle)

Initializes a new instance of the LogStore class for the specified handle.

LogStore(String, FileMode)

Initializes a new instance of the LogStore class with the specified path and mode.

LogStore(String, FileMode, FileAccess)

Initializes a new instance of the LogStore class with the specified path, mode, and access.

LogStore(String, FileMode, FileAccess, FileShare)

Initializes a new instance of the LogStore class.

LogStore(String, FileMode, FileAccess, FileShare, FileSecurity)

Initializes a new instance of the LogStore class.

LogStore(SafeFileHandle)

Initializes a new instance of the LogStore class for the specified handle.

public:
 LogStore(Microsoft::Win32::SafeHandles::SafeFileHandle ^ handle);
public LogStore (Microsoft.Win32.SafeHandles.SafeFileHandle handle);
new System.IO.Log.LogStore : Microsoft.Win32.SafeHandles.SafeFileHandle -> System.IO.Log.LogStore
Public Sub New (handle As SafeFileHandle)

Parameters

handle
SafeFileHandle

A file handle for the log file that the current LogStore object encapsulates.

Exceptions

handle is null.

The log handle could not be bound to the thread pool.

Access for the specified log store is denied by the operating system.

The method was called after the sequence has been disposed of.

There is not enough memory to continue the execution of a program.

Applies to

LogStore(String, FileMode)

Initializes a new instance of the LogStore class with the specified path and mode.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode);
public LogStore (string path, System.IO.FileMode mode);
new System.IO.Log.LogStore : string * System.IO.FileMode -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode)

Parameters

path
String

A relative or absolute path for the base file of the log store to open.

mode
FileMode

One of the FileMode values that determines how to open or create the store.

Exceptions

path is null.

path is an empty string ("").

-or-

path contains only white space.

-or-

path contains one or more invalid characters.

mode contains an invalid value.

The file cannot be found.

An I/O error occurs when opening the log store.

Access for the specified log store is denied by the operating system.

LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

There is not enough memory to continue the execution of a program.

Remarks

Use this constructor to open a log store with the specified path and mode. The store is opened with read/write access, and shares read access.

The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. A log store should be either a physical log store or a virtual log store, but not both. Once a log store has been created physically or virtually, it remains so for its lifetime. A physical log store is created by specifying only the physical log name. A virtual log store is created by specifying both the physical log name and the log client name.

Clients that share the same physical log name share the same extents collection and policy.

Applies to

LogStore(String, FileMode, FileAccess)

Initializes a new instance of the LogStore class with the specified path, mode, and access.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode, access As FileAccess)

Parameters

path
String

A relative or absolute path for the base file of the log store to open.

mode
FileMode

One of the FileMode values that determines how to open or create the store.

access
FileAccess

One of the FileAccess values that determines how the file can be accessed by the LogStore.

Exceptions

path is null.

path is an empty string ("").

-or-

path contains only white space.

-or-

path contains one or more invalid characters.

mode contains an invalid value.

-or

access contains an invalid value.

The file cannot be found.

An I/O error occurs when opening the log store.

Access for the specified log store is denied by the operating system.

LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

There is not enough memory to continue the execution of a program.

Remarks

Use this constructor to open a new log store with the specified path, mode, and access. The store is opened sharing read access.

The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. A log store should be either a physical log store or a virtual log store, but not both. Once a log store has been created physically or virtually, it remains so for its lifetime. A physical log store is created by specifying only the physical log name. A virtual log store is created by specifying both the physical log name and the log client name.

Clients that share the same physical log name share the same extents collection and policy.

Applies to

LogStore(String, FileMode, FileAccess, FileShare)

Initializes a new instance of the LogStore class.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare)

Parameters

path
String

A relative or absolute path for the base file of the log store to open.

mode
FileMode

One of the FileMode values that determines how to open or create the store.

access
FileAccess

One of the FileAccess values that determines how the file can be accessed by the LogStore.

share
FileShare

One of the FileShare values that determines how the log store will be shared among processes.

Exceptions

path is null.

path is an empty string ("").

-or-

path contains only white space.

-or-

path contains one or more invalid characters.

mode contains an invalid value.

-or

access contains an invalid value.

-or-

share contains an invalid value.

The file cannot be found.

An I/O error occurs when opening the log store.

Access for the specified log store is denied by the operating system.

LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

There is not enough memory to continue the execution of a program.

Remarks

This constructor initializes a new LogStore object that it opens with the specified path, mode, and access. The store is opened sharing the specified access.

The path parameter should use the following syntax:

log:<physical log name>[::<log client name>]

where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. A log store should be either a physical log store or a virtual log store, but not both. Once a log store has been created physically or virtually, it remains so for its lifetime. A physical log store is created by specifying only the physical log name. A virtual log store is created by specifying both the physical log name and the log client name.

Clients that share the same physical log name share the same extents collection and policy.

Applies to

LogStore(String, FileMode, FileAccess, FileShare, FileSecurity)

Initializes a new instance of the LogStore class.

public:
 LogStore(System::String ^ path, System::IO::FileMode mode, System::IO::FileAccess access, System::IO::FileShare share, System::Security::AccessControl::FileSecurity ^ fileSecurity);
public LogStore (string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Security.AccessControl.FileSecurity fileSecurity);
new System.IO.Log.LogStore : string * System.IO.FileMode * System.IO.FileAccess * System.IO.FileShare * System.Security.AccessControl.FileSecurity -> System.IO.Log.LogStore
Public Sub New (path As String, mode As FileMode, access As FileAccess, share As FileShare, fileSecurity As FileSecurity)

Parameters

path
String

A relative or absolute path for the base file of the log store to open.

mode
FileMode

One of the FileMode values that determines how to open or create the store.

access
FileAccess

One of the FileAccess values that determines how the file can be accessed by the LogStore.

share
FileShare

One of the FileShare values that determines how the log store will be shared among processes.

fileSecurity
FileSecurity

One of the FileSecurity value that specifies the security to set on the newly created store if the store must be created.

Exceptions

path is null.

The log store file name specified by path is not valid.

-or-

Mode is CreateNew, which cannot be used without write access.

-or-

Mode is OpenOrCreate, which cannot be used without write access.

mode contains an invalid value.

-or

access contains an invalid value.

-or-

share contains an invalid value.

The file cannot be found.

An I/O error occurs when opening the log store.

The file specified by path cannot be accessed because it is in use by another process.

-or-

The file specified by path cannot be created because the file or directory already exists.

-or-

The log handle could not be bound to the thread pool.

-or-

The specified log file format or version is invalid.

LogStore cannot be used because the required Common Log File System (CLFS) component is not installed. Install the CLFS component if it is available for your platform or use the FileRecordSequence class instead.

The method was called after the sequence has been disposed of.

There is not enough memory to continue the execution of a program.

The record sequence is full.

Access for the specified log store is denied by the operating system.

Remarks

This constructor initializes a new LogStore object that it opens with the specified path, mode, and access. The store is opened sharing the specified access. The path parameter should follow the following syntax:

log:<physical log name>[::<log client name>]

where <physical log name> is a valid path to a log file, and <log client name> is a unique client identifier. A log store should be either a physical log store or a virtual log store, but not both. Once a log store has been created physically or virtually, it remains so for its lifetime. A physical log store is created by specifying only the physical log name. A virtual log store is created by specifying both the physical log name and the log client name.

Clients that share the same physical log name share the same extents collection and policy.

Applies to