Skip to main content

Logging Configuration

Configure logging levels and module-specific logging for Watch Tower. The Watch Tower provides flexible logging configuration through the LOG_LEVEL environment variable. You can control both global and module-specific logging levels.

Log levels

The following log levels are available, from most to least verbose:
  • TRACE - Most detailed logging
  • DEBUG - Debug information
  • INFO - Informational messages
  • WARN - Warning messages
  • ERROR - Error messages only

Setting the log level

Set the LOG_LEVEL environment variable to control logging verbosity:

Module-specific logging

You can override the log level for specific modules using comma-separated values:
This sets the global log level to WARN, but enables INFO level logging for the chainContext module.

Multiple module overrides

Specify multiple module overrides separated by commas:
In this example:
  • Global log level: WARN
  • chainContext module: INFO
  • _placeOrder module: TRACE

Regex patterns for logger names

Module names can be regex patterns, allowing fine-grained control over logging:

Pattern matching examples

Use single quotes around the LOG_LEVEL value when using regex patterns to prevent shell interpretation of special characters.

Complex logging configuration

Combine multiple techniques for precise control:
This configuration:
  • Sets global log level to WARN
  • Enables DEBUG for commands module
  • Sets WARN for loggers starting with checkForAndPlaceOrder
  • Sets INFO for loggers starting with chainContext
  • Sets INFO for _checkForAndPlaceOrder:1: loggers

Using with Docker

When running the Watch Tower in Docker, pass the LOG_LEVEL environment variable:

Using with environment files

Create a .env file for persistent configuration:
Or with module-specific logging:
Then load it with Docker:

Common logging patterns

Tips

  • Start with WARN in production to reduce log volume
  • Use DEBUG or TRACE when troubleshooting specific issues
  • Module-specific logging helps debug particular components without flooding logs
  • Regex patterns are powerful but require careful escaping in shell commands
  • Remember to quote complex LOG_LEVEL values containing special characters
Last modified on March 4, 2026