fix: better way to instantiate websocket sink

This commit is contained in:
Neil Dorin
2023-11-06 19:24:03 -07:00
parent 2223e09283
commit 7517666614

View File

@@ -106,12 +106,13 @@ namespace PepperDash.Core
{
_consoleLoggingLevelSwitch = new LoggingLevelSwitch(initialMinimumLevel: LogEventLevel.Information);
_websocketLoggingLevelSwitch = new LoggingLevelSwitch();
_websocketSink = new DebugWebsocketSink();
// Instantiate the root logger
_logger = new LoggerConfiguration()
//.WriteTo.Logger(lc => lc
//.WriteTo.Console(levelSwitch: _consoleLoggingLevelSwitch))
.WriteTo.Sink(_websocketSink = new DebugWebsocketSink(), levelSwitch: _websocketLoggingLevelSwitch)
.WriteTo.Sink(_websocketSink, levelSwitch: _websocketLoggingLevelSwitch)
.WriteTo.File(@"\user\debug\global-log-{Date}.txt"
, rollingInterval: RollingInterval.Day
, restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Debug)