Class ConsoleJsonLogExporterOptions
Specifies the options used to configure a ConsoleJsonLogExporter.
Namespace: Neon.Diagnostics
Assembly: Neon.Common.dll
Syntax
public class ConsoleJsonLogExporterOptions
Constructors
ConsoleJsonLogExporterOptions()
Constructs an instance with reasonable settings.
Declaration
public ConsoleJsonLogExporterOptions()
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 |
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 |
SingleLine
Specifies whether the log event JSON written to the console should be formatted as single lines of JSON (the default) or render these as indented multi-line JSON separated by a blank line.
note
This may be useful for debugging but should probably never be used for production. This
defaults to true
.
Declaration
public bool SingleLine { get; set; }
Property Value
Type | Description |
---|---|
bool |
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.