diff --git a/Source/AppScaffolding/LibationScaffolding.cs b/Source/AppScaffolding/LibationScaffolding.cs index 2653ab57..2b512e81 100644 --- a/Source/AppScaffolding/LibationScaffolding.cs +++ b/Source/AppScaffolding/LibationScaffolding.cs @@ -121,7 +121,7 @@ namespace AppScaffolding zipFileSink["Name"] = "File"; fileChanged = true; } - var hooks = $"{nameof(LibationFileManager)}.{nameof(FileSinkHook)}, {nameof(LibationFileManager)}"; + var hooks = typeof(FileSinkHook).AssemblyQualifiedName; if (serilog.SelectToken("$.WriteTo[?(@.Name == 'File')].Args", false) is JObject fileSinkArgs && fileSinkArgs["hooks"]?.Value() != hooks) { @@ -158,7 +158,8 @@ namespace AppScaffolding // - with class and method info: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] (at {Caller}) {Message:lj}{NewLine}{Exception}"; // output example: 2019-11-26 08:48:40.224 -05:00 [DBG] (at LibationWinForms.Program.init()) Begin Libation // {Properties:j} needed for expanded exception logging - { "outputTemplate", "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] (at {Caller}) {Message:lj}{NewLine}{Exception} {Properties:j}" } + { "outputTemplate", "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] (at {Caller}) {Message:lj}{NewLine}{Exception} {Properties:j}" }, + { "hooks", typeof(FileSinkHook).AssemblyQualifiedName }, // for FileSinkHook } } } diff --git a/Source/LibationFileManager/Configuration.Logging.cs b/Source/LibationFileManager/Configuration.Logging.cs index ffb36771..70fdbc0b 100644 --- a/Source/LibationFileManager/Configuration.Logging.cs +++ b/Source/LibationFileManager/Configuration.Logging.cs @@ -27,6 +27,7 @@ namespace LibationFileManager //https://github.com/serilog/serilog-settings-configuration/issues/406 var readerOptions = new ConfigurationReaderOptions( typeof(ILogger).Assembly, // Serilog + typeof(LoggerCallerEnrichmentConfiguration).Assembly, // Dinah.Core typeof(LoggerEnrichmentConfigurationExtensions).Assembly, // Serilog.Exceptions typeof(ConsoleLoggerConfigurationExtensions).Assembly, // Serilog.Sinks.Console typeof(FileLoggerConfigurationExtensions).Assembly); // Serilog.Sinks.File