Export (0) Print
Expand All

LogStore Constructor (String, FileMode)

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

Namespace:  System.IO.Log
Assembly:  System.IO.Log (in System.IO.Log.dll)

public LogStore(
	string path,
	FileMode mode
)

Parameters

path
Type: System.String

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

mode
Type: System.IO.FileMode

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

ExceptionCondition
ArgumentNullException

path is null.

ArgumentException

path is an empty string ("").

-or-

path contains only white space.

-or-

path contains one or more invalid characters.

ArgumentOutOfRangeException

mode contains an invalid value.

FileNotFoundException

The file cannot be found.

IOException

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

UnauthorizedAccessException

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

PlatformNotSupportedException

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.

OutOfMemoryException

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

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft