Skip to main content
Version: Next

Customizing logging


Hydra is configuring Python standard logging library with the dictConfig method. You can learn more about it here. There are two logging configurations, one for Hydra itself and one for the executed jobs.

This example demonstrates how to customize the logging behavior of your Hydra app, by making the following changes to the default logging behavior:

  • Outputs only to stdout (no log file)
  • Output a simpler log line pattern
defaults:  - override hydra/job_logging: custom
version: 1formatters:  simple:    format: '[%(levelname)s] - %(message)s'handlers:  console:    class: logging.StreamHandler    formatter: simple    stream: ext://sys.stdoutroot:  handlers: [console]
disable_existing_loggers: false

This is what the default logging looks like:

$ python hydra/job_logging=default[2020-08-24 13:43:26,761][__main__][INFO] - Info level message

And this is what the custom logging looks like:

$ python [INFO] - Info level message