Skip to content

[DOCS] Update incorrect details for log_granular_levels section of doc/ref/configuration/logging/index.rst #66884

Closed as not planned

Description

@austinbrowder

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:

  log_granular_levels:
    'salt': 'warning'
    'salt.modules': 'info'
    'salt.loader.saltmaster.ext.module.custom_module': 'debug'
    'salt.loaded.ext.module.custom_module': 'debug'
    'salt.loaded.ext.states.custom_module': 'debug'

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

Activity

  1. added
    documentation
    on Sep 12, 2024
  2. welcome commented on Sep 12, 2024

    @welcome

    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!

  3. added this to the Potassium v3009.0 milestone on Jun 25, 2026
  4. added a commit that references this issue on Sep 23, 2026
    299123d
  5. added a commit that references this issue on Sep 24, 2026
    998390d
  6. dwoz commented on Oct 28, 2026

    @dwoz
    Contributor

    Closing — consolidated into #70585. The checkbox for this item is in the appropriate theme section of that tracker. Please pick up the sub-item there.

  7. added a commit that references this issue on Oct 30, 2026
    338defd
  8. added a commit that references this issue on Nov 13, 2026
    35e60f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions