-
Notifications
You must be signed in to change notification settings - Fork 345
Closed
Labels
Description
Software versions
MySqlConnector.Logging.Microsoft.Extensions.Logging version: 2.0.0
Describe the bug
The mentioned package is not prefixing the log categories.
So I see categories like "ConnectionPool" instead of "MySqlConnector.ConnectionPool".
Because of this, collisions are possible and I cannot filter all the MySqlConnector logs with single filter, need to know each possible category.
Here is the missing prefix:
Line 11 in 44d5c26
public IMySqlConnectorLogger CreateLogger(string name) => new MicrosoftExtensionsLoggingLogger(m_loggerFactory.CreateLogger(name)); |
The other logging packages DO prefix:
public IMySqlConnectorLogger CreateLogger(string name) => new Log4netLogger(LogManager.GetLogger(s_loggerAssembly, "MySqlConnector." + name)); |
public SerilogLogger(string name) => m_logger = Serilog.Log.ForContext("SourceContext", "MySqlConnector." + name); |
public IMySqlConnectorLogger CreateLogger(string name) => new NLogLogger(LogManager.GetLogger("MySqlConnector." + name)); |
Exception
Not applicable.
Code sample
LoggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(cfg =>
cfg.AddConsole()
.SetMinimumLevel(LogLevel.Debug)
.AddFilter("ConnectionPool", LogLevel.Information) //How can I filter all MySqlConnector logs? How I can know all posible categories?
);
MySqlConnectorLogManager.Provider = new MicrosoftExtensionsLoggingLoggerProvider(LoggerFactory);
Expected behavior
I expect a prefix "MySqlConnector." just like on the other loggers.
Additional context
None