Class FileLoggerProvider
Writes log lines to a new file per session; the terminal is owned by the UI, so console logging is not an option.
Inherited Members
Namespace: Uniform.Matrix.Hosting
Assembly: Uniform.Matrix.Hosting.dll
Syntax
[ProviderAlias("File")]
public sealed class FileLoggerProvider : ILoggerProvider, IDisposable
Remarks
Levels are configured like other providers, e.g. Logging:File:LogLevel:Default. Files are named by CreateSessionPath(string, DateTime, string), and old ones are pruned at start.
Constructors
| Edit this page View SourceFileLoggerProvider(string, int, string)
Start a session log in directory, named by name, keeping at most keep session logs.
Declaration
public FileLoggerProvider(string directory, int keep, string name = "client")
Parameters
| Type | Name | Description |
|---|---|---|
| string | directory | |
| int | keep | |
| string | name |
Properties
| Edit this page View SourceFilePath
Log file of this session.
Declaration
public string FilePath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceCreateLogger(string)
Create a logger writing to this file.
Declaration
public ILogger CreateLogger(string categoryName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | categoryName |
Returns
| Type | Description |
|---|---|
| ILogger |
Dispose()
Close the file.
Declaration
public void Dispose()