Skip to content

Conversation

tikibozo
Copy link

@tikibozo tikibozo commented Jul 3, 2025

Summary

Adds configurable logging levels to reduce log noise in container deployments.
Issue: #568

Changes

  • Add LOG_LEVEL environment variable support
  • Configure all loggers to respect the log level
  • Change default from DEBUG to INFO level
  • Update Docker configuration
  • Update documentation

Testing

Python Syntax & Import Tests

  • Both modified Python files (settings_manager.py, logger.py) compile without syntax errors
  • New logging functions (get_log_level(), configure_root_logger()) are properly defined and callable
  • Environment variable handling works correctly:
    • LOG_LEVEL=DEBUG → returns 10 (DEBUG level)
    • Default when not set → returns 20 (INFO level)

Docker Integration Tests

  • Docker build completes successfully with new environment variable
  • ENV LOG_LEVEL=INFO properly set as default in Dockerfile
  • LOG_LEVEL=${LOG_LEVEL:-INFO} works correctly in docker-compose.yml
  • Container environment variable handling:
    • Default: LOG_LEVEL=INFO in container
    • Override: -e LOG_LEVEL=WARNING properly overrides to WARNING

Environment Variable Validation

  • Default behavior: LOG_LEVEL defaults to INFO when environment variable not set
  • Override behavior: Environment variable properly overrides default value
  • Container integration: Both default and runtime override scenarios work correctly

Breaking Changes

None - fully backward compatible.

- Add LOG_LEVEL environment variable support (DEBUG, INFO, WARNING, ERROR, CRITICAL)
- Change default logging level from DEBUG to INFO to reduce noise
- Configure root logger to ensure all loggers respect LOG_LEVEL setting
- Update Docker configuration to support LOG_LEVEL
- Update documentation to reflect new optional environment variable and available values
@tikibozo
Copy link
Author

tikibozo commented Jul 3, 2025

What an unfortunate PR number 😅 It's safe I tested it!

Also I sound grumpy in the linked issue, I'm not! Thanks for all your efforts! Hope this helps/thanks for looking at it.

@Admin9705
Copy link
Contributor

This is great work. i'll test it out and try to implement.

- Change verbose INFO messages to DEBUG for technical internals
- Maintain user-friendly INFO messages for key actions and results
- Update logger configuration for consistent formatting across modules
- Apply uniform logging patterns to all app modules (sonarr, radarr, lidarr, readarr, whisparr)
- Remove timezone labels from individual log lines for cleaner output

This significantly reduces log noise while keeping important user-facing information visible.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@tikibozo
Copy link
Author

tikibozo commented Aug 6, 2025

I've expanded this PR a bit to recategorize a bunch of internals from info to debug level also, along with removing the long-form timezone from the datestamp for file size and clarity. I also cleaned up a couple loggers that were using the default logging format instead of the custom Huntarr scheme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants