Class ConsoleTextLogExporterOptions
Specifies the options used to configure a ConsoleJsonLogExporter.
Namespace: Neon.Diagnostics
Assembly: Neon.Common.dll
Syntax
public class ConsoleTextLogExporterOptions
Constructors
ConsoleTextLogExporterOptions()
Constructs an instance with reasonable settings.
Declaration
public ConsoleTextLogExporterOptions()
Properties
Emit
Used to disable writing events to the output stream. This can be useful for unit testing. This is enabled by default.
note
Any configured LogEventInterceptor actions will still be called
event when Emit is configured as false
.
Declaration
public bool Emit { get; set; }
Property Value
Type | Description |
---|---|
bool |
EmitToAttachedDebugger
Used to disable writing logs to an attached debugger's output window. This is enabled by default.
Declaration
public bool EmitToAttachedDebugger { get; set; }
Property Value
Type | Description |
---|---|
bool |
ExceptionStackTraces
Specifies whether exception stack traces should be included in logged events.
This defaults to true
.
Declaration
public bool ExceptionStackTraces { get; set; }
Property Value
Type | Description |
---|---|
bool |
Format
Used to set the log format.
Declaration
public Func<LogRecord, string> Format { get; set; }
Property Value
Type | Description |
---|---|
Func<LogRecord, string> |
LogEventInterceptor
Used to intercept log events just before they are emitted by the exporter. You can use this for implementing logging related unit tests or modifying other event properties like the timestamp, labels, tags, etc.
Declaration
public LogEventInterceptor LogEventInterceptor { get; set; }
Property Value
Type | Description |
---|---|
LogEventInterceptor |
StandardErrorLevel
Used to direct log output for events to standard error based on the event log level.
Declaration
public LogLevel StandardErrorLevel { get; set; }
Property Value
Type | Description |
---|---|
LogLevel |
Remarks
By default, ConsoleJsonLogExporter writes logs to standard output because this property defaults to LogLevel.None. You may override this by setting this to another level; then events with log levels >= this property will be written to standard error instead.
Set this to LogLevel.Critical to send all logs to standard output.