You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
The instructions for log_granular_levels show how to set a custom module to the log level all but in practice this does not work. Not sure if this is due to all not being a native log level within Pythons logging module.
Additionally, the following sentence needs updating.
You can determine what log call name to use here by adding %(module)s to the log format.
In practice Ive found that %(module)s only prints the short name of the module (i.e. custom_module).
However, %(name)s prints the fully qualified name of the module (i.e. salt.loaded.ext.module.custom_module).
Suggested Fix
Updated doc example:
log_granular_levels
Default: {}
This can be used to control logging levels more specifically, based on log call name. The example sets
the main salt library at the warning level, sets salt.modules to log
at the info level, and sets custom modules to the debug level:
You can determine what log call name to use here by adding %(name)s to the
log format. Typically, it is the path of the file which generates the log
without the trailing .py and with path separators replaced with .
Note: For these granular log levels to be reflected in the logs, the log_level_logfile and/or log_level
configurations must be set to at least the lowest level specified in the granular settings. For example, if
you set a module to log at the debug level in log_granular_levels, the log_level_logfile or log_level
must be set to debug for those debug logs to be written. Otherwise, the more restrictive general log level
will take precedence.
Type of documentation
Salt documentation
Location or format of documentation doc/ref/configuration/logging/index.rst
The text was updated successfully, but these errors were encountered:
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
Description
The instructions for
log_granular_levels
show how to set a custom module to the log levelall
but in practice this does not work. Not sure if this is due toall
not being a native log level within Pythons logging module.Additionally, the following sentence needs updating.
In practice Ive found that
%(module)s
only prints the short name of the module (i.e.custom_module
).However,
%(name)s
prints the fully qualified name of the module (i.e.salt.loaded.ext.module.custom_module
).Suggested Fix
Updated doc example:
Type of documentation
Location or format of documentation
doc/ref/configuration/logging/index.rst
The text was updated successfully, but these errors were encountered: