-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does it support configuring appsettings. json? #317
Comments
SetDefaultMinLogLevel is used for initial setup until server-side log level settings are available. To integrate with Microsoft's logging, use the Exceptionless.Extensions.Logging package https://github.com/exceptionless/Exceptionless.Net/tree/main/src/Platforms/Exceptionless.Extensions.Logging from NuGet. Rely on the existing logging configuration for Microsofts logging implementation, as we only serve as a logging provider. SetDefaultMinLogLevel and server log levels will apply to any log messages received to our logging provider (e.g., the ExceptionlessClient instance). |
@niemyjski But I still sent the info warn logs to the Exceptionless server, so I want to try configuring filtering out logs below the error level in the "appsettings.json", but the following configuration doesn't seem to have taken effect either
|
What was your project log level settings set to? The SetDefaultMinLogLevel is replaced by the server side setting shortly after at startup. AppSettings log level settings controls the Microsoft Logging and all of it's configured log providers (exceptionless is part of this), it's what gathers and forwards the logs if they are not filtered out by the config above to the exceptionless logging provider. Then exceptionless server side log levels come into play. So if you are filtering outto the error log level then exceptionless should never get anything lower than errors (unless you have fatal/critical log levels configured in exceptionless), then errors will be skipped by the exceptionless logging provider. |
After configuring the console provider as default error, the console will only output logs above the error level, as follows:
So I think the Netcore framework can perform log level filtering through the provider. I am planning to output low-level logs on the console and error level logs to Exceptionless. My ideal configuration would be as follows:
But the configuration is not effective |
If you could update our sample and debug this it would be a huge help. But I don't remember it working like this at least for our provider? |
You'd need to configure the logging levels for what is logging, which is diagnostics and lifetime. I'd look at the full namesapce + type and add it to the normal asp.net core logging config or serilog config if using serilog. The entry for ExceptionlessLoggerProvider is invalid and won't do anything. If you want to log these to your app console but not to us, then you'll need to SetDefaultMinLogLevel like you are doing and or add a configuration entry for the internal log level like this
|
I found the alias Console in the Console LoggerProvider, but did not find any alias in the Exceptional LoggerProvider. Attempted Exceptionless, ExceptionlessLogger, and ExceptionlessLoggerProvider, but none of them worked. Information logs are still being recorded
I want to exclude the info log and try using the following configuration, but it still doesn't work.
logging.AddExceptionless(config => config.SetDefaultMinLogLevel(Exceptionless.Logging.LogLevel.Error));
The text was updated successfully, but these errors were encountered: