diff --git a/src/Pepperdash Core/Logging/Debug.cs b/src/Pepperdash Core/Logging/Debug.cs
index 3555df5..a5e49f4 100644
--- a/src/Pepperdash Core/Logging/Debug.cs
+++ b/src/Pepperdash Core/Logging/Debug.cs
@@ -148,7 +148,7 @@ namespace PepperDash.Core
.MinimumLevel.Verbose()
.Enrich.FromLogContext()
.Enrich.With(new CrestronEnricher())
- .WriteTo.Sink(new DebugConsoleSink(new ExpressionTemplate("[{@t}][{@l}][{App}][{Key:3}]{@m}\n{@x}")), levelSwitch: _consoleLoggingLevelSwitch)
+ .WriteTo.Sink(new DebugConsoleSink(new ExpressionTemplate("[{@t:yyyy-MM-dd HH:mm:ss.fff}][{@l:u4}][{App}]{#if Key is not null}[{Key}]{#end} {@m}{#if @x is not null}\r\n{@x}{#end}")), levelSwitch: _consoleLoggingLevelSwitch)
.WriteTo.Sink(_websocketSink, levelSwitch: _websocketLoggingLevelSwitch)
.WriteTo.Sink(new DebugErrorLogSink(), levelSwitch: _errorLogLevelSwitch)
.WriteTo.File(new RenderedCompactJsonFormatter(), logFilePath,
@@ -593,7 +593,7 @@ namespace PepperDash.Core
/// Args to put into message template
public static void LogMessage(Exception ex, string message, IKeyed device = null, params object[] args)
{
- using (LogContext.PushProperty("Key", device?.Key ?? string.Empty))
+ using (LogContext.PushProperty("Key", device?.Key))
{
_logger.Error(ex, message, args);
}
@@ -608,7 +608,7 @@ namespace PepperDash.Core
/// Args to put into message template
public static void LogMessage(LogEventLevel level, string message, IKeyed device=null, params object[] args)
{
- using (LogContext.PushProperty("Key", device?.Key ?? string.Empty))
+ using (LogContext.PushProperty("Key", device?.Key))
{
_logger.Write(level, message, args);
}