exceptionless / Exceptionless.Net

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

NLog ExceptionlessTarget SetDefaultMinLogLevel #303

Closed snakefoot closed 1 year ago

snakefoot commented 1 year ago

See also: https://github.com/exceptionless/Exceptionless.Net/issues/260

snakefoot commented 1 year ago

Maybe the override-logic of the call to SetDefaultMinLogLevel on the default-client should be: "only override if not configured already" ? (Similar to the logger-override, that only happens when default null-logger).

niemyjski commented 1 year ago

Yeah we could add an extension or check for that, wouldn't be a bad idea.

niemyjski commented 1 year ago

@snakefoot I just looked at the implementation and it already handles this :)

        public void SetDefaultMinLogLevel(LogLevel minLogLevel) {
            if (!Settings.ContainsKey("@@log:*"))
                Settings.Add("@@log:*", minLogLevel.ToString());
        }