You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SerilogFactory.Create(string name, Castle.Core.Logging.LoggerLevel level) overload modifies the MinimumLevel of the passed in LoggerConfiguration and overwrites it with the equivalent logging level to the Castle LoggerLevel enum. Each call of the Create method will modify the single LoggerConfiguration object with the level being passed in.
There is no need for the Serilog integration to support this overload, it is only there for loggers that don't support levels (e.g. ConsoleLogger, TraceLogger) which use LevelFilteredLogger. It just confuses things to have two logging frameworks filtering by log levels. Both log4net and NLog integrations throw a NotSupportedException for this overload.
var config = new LoggerConfiguration()
.WriteTo....
var factory = new SerilogFactory(config);
var logger = factory.Create("MyLogger", LoggerLevel.Debug); <-- config has been modified by the factory
The text was updated successfully, but these errors were encountered:
I've removed the implementation of this overload, and changed it to throw an exception like the log4net and NLog ones so users don't get bitten by this.
The
SerilogFactory.Create(string name, Castle.Core.Logging.LoggerLevel level)
overload modifies theMinimumLevel
of the passed inLoggerConfiguration
and overwrites it with the equivalent logging level to the CastleLoggerLevel
enum. Each call of theCreate
method will modify the singleLoggerConfiguration
object with the level being passed in.There is no need for the Serilog integration to support this overload, it is only there for loggers that don't support levels (e.g.
ConsoleLogger
,TraceLogger
) which useLevelFilteredLogger
. It just confuses things to have two logging frameworks filtering by log levels. Both log4net and NLog integrations throw aNotSupportedException
for this overload.Core/src/Castle.Services.Logging.SerilogIntegration/SerilogFactory.cs
Line 53 in a7f593a
The text was updated successfully, but these errors were encountered: