exceptionless / Exceptionless.Net

Exceptionless clients for the .NET platform
https://exceptionless.com
Other
554 stars 142 forks source link

NLog plugin minLevel not work #244

Closed jol5 closed 3 years ago

jol5 commented 3 years ago
// 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

ENV: netcore 3.1 NLog 4.7.7 Exceptionless.NLog 4.6.2 image

niemyjski commented 3 years ago

Hello,

Thanks for reaching out to us!

samchenws commented 3 years ago

你好,

感谢您与我们联系!

image

samchenws commented 3 years ago

The log level is always a warning

niemyjski commented 3 years ago

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 3 years ago

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.