Logging Configuration
Configure logging levels and module-specific logging for Watch Tower. The Watch Tower provides flexible logging configuration through theLOG_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 loggingDEBUG- Debug informationINFO- Informational messagesWARN- Warning messagesERROR- Error messages only
Setting the log level
Set theLOG_LEVEL environment variable to control logging verbosity:
Module-specific logging
You can override the log level for specific modules using comma-separated values:WARN, but enables INFO level logging for the chainContext module.
Multiple module overrides
Specify multiple module overrides separated by commas:- Global log level:
WARN chainContextmodule:INFO_placeOrdermodule: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:- Sets global log level to
WARN - Enables
DEBUGforcommandsmodule - Sets
WARNfor loggers starting withcheckForAndPlaceOrder - Sets
INFOfor loggers starting withchainContext - Sets
INFOfor_checkForAndPlaceOrder:1:loggers
Using with Docker
When running the Watch Tower in Docker, pass theLOG_LEVEL environment variable:
Using with environment files
Create a.env file for persistent configuration:
Common logging patterns
Tips
- Start with
WARNin production to reduce log volume - Use
DEBUGorTRACEwhen 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_LEVELvalues containing special characters