NLog plugin minLevel not work
jol5 opened this issue · 5 comments
jol5 commented
// Test NLog
var config = new LoggingConfiguration();
var exceptionlessTarget = new ExceptionlessTarget();
config.AddTarget("exceptionless", exceptionlessTarget);
config.LoggingRules.Add(new LoggingRule("*", global::NLog.LogLevel.Debug, exceptionlessTarget));
LogManager.Configuration = config;
var logger = LogManager.GetCurrentClassLogger();
logger.Warn()
.Message("App Starting...")
.Tag("Tag1", "Tag2")
.Property("LocalProp", "LocalValue")
.Property("Order", new { Total = 15 })
.Write();
follow code only warn,error log
will send to Exceptionless
niemyjski commented
Hello,
Thanks for reaching out to us!
- Have you tried turning on diagnostic logs locally and seeing what is occurring in the logs? https://exceptionless.com/docs/clients/dotnet/troubleshooting/#enable-client-logging
- Did you set the DefaultMinLevelLog in configuration which sets a default until server settings are defined? https://github.com/exceptionless/Exceptionless.Net/blob/master/src/Exceptionless/Configuration/ExceptionlessConfiguration.cs#L213
- Do you have warning as your project level default log level or for this specific stack? https://exceptionless.com/docs/setting-log-levels/
samchenws commented
你好,
感谢您与我们联系!
- 您是否尝试过在本地打开诊断日志并查看日志中发生了什么?https://exceptionless.com/docs/clients/dotnet/troubleshooting/#enable-client-logging
- 您是否在配置中设置了DefaultMinLevelLog,该配置会在定义服务器设置之前设置默认值?https://github.com/exceptionless/Exceptionless.Net/blob/master/src/Exceptionless/Configuration/ExceptionlessConfiguration.cs#L213
- 您是否将警告作为项目级别的默认日志级别或针对此特定堆栈的警告?https://exceptionless.com/docs/setting-log-levels/
ENV:
dotnet5
NLog.Web.AspNetCore 4.10.0
Exceptionless.NLog
The problem does exist.
samchenws commented
The log level is always a warning
niemyjski commented
This should work if you remove the api key from the nlog config section. When you specify an api key there it uses an internal Exceptionless client instance. Does this fix this issue?
samchenws commented
This should work if you remove the api key from the nlog config section. When you specify an api key there it uses an internal Exceptionless client instance. Does this fix this issue?
OK, it works.
Thank you very much.