BedeGaming / sinks-rollingfile

A serilog sink for rolling files based on size and time
Apache License 2.0
15 stars 20 forks source link

MinimumLevel.Verbose doesn't seem to work #44

Closed jceddy closed 7 years ago

jceddy commented 7 years ago

I have a logger being created with minimum level == Verbose, like this:

Logger log = new LoggerConfiguration().WriteTo.RollingFileAlternate( FrameworkSettings.Logging.ClientPath, logFilePrefix, minimumLevel: _minumumLevel, outputTemplate: _outputTemplate, fileSizeLimitBytes: 10 1024 1024, retainedFileCountLimit: 100 ).CreateLogger();

But when I use the "Verbose" function to write to the log:

writer.Verbose(logEntry.ExtendedProperties.ContainsKey("Exception") ? (Exception)logEntry.ExtendedProperties["Exception"] : null, formattedMessage);

Nothing is written.

This works fine with other logging levels such as "Information", though...

nblumhardt commented 7 years ago

Hi @jceddy - you'll need to call .MinimumLevel.Verbose() on the LoggerConfiguration to turn on verbose logging - the minimumLevel parameter here is just a filter. HTH!

jceddy commented 7 years ago

@nblumhardt Thanks.