fix(gui-client): apply log directives from MDM config - #9443
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR applies MDM log directives to the GUI client by attempting to reload the logging configuration when provided by the MDM settings.
- Added conditional logic to check for log directives and reload the logging configuration.
- Logs an informational message if applying the directives fails.
|
|
||
| if let Some(directives) = mdm_settings.log_filter.as_ref() { | ||
| if let Err(e) = reloader.reload(directives) { | ||
| tracing::info!(%directives, "Failed to apply MDM logging directives: {e:#}"); |
There was a problem hiding this comment.
[nitpick] Consider reviewing the choice of log level. If failing to apply log directives is a critical issue, it may be more appropriate to use a higher log level (e.g., warning or error) instead of informational.
| tracing::info!(%directives, "Failed to apply MDM logging directives: {e:#}"); | |
| tracing::warn!(%directives, "Failed to apply MDM logging directives: {e:#}"); |
There was a problem hiding this comment.
Logging this on INFO because we don't want Sentry alerts for it.
There was a problem hiding this comment.
It would be nice if Sentry had logic to log a sampled %, or ignore the second and later logs for an event.
There was a problem hiding this comment.
There is sampling but it is not per event.
When introducing the MDM config, we took into account the log directives from the config when applying it via the GUI but failed to apply the new directives on startup.