Set logs level to WARN for production image - #3942
Conversation
There was a problem hiding this comment.
Pull request overview
This PR changes the logging levels for several library loggers from DEBUG to WARN in the main logback.xml configuration file. The PR title indicates this is intended for production images, but the implementation affects all environments.
Changes:
- Updated log levels from DEBUG to WARN for org.mapfish, com.codahale, org.springframework, org.apache, and org.hibernate loggers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <logger name="org.mapfish" level="WARN" /> | ||
| <logger name="com.codahale" level="WARN" /> | ||
| <logger name="org.springframework" level="WARN" /> | ||
| <logger name="org.apache" level="WARN" /> | ||
| <logger name="org.hibernate" level="WARN" /> |
There was a problem hiding this comment.
This logging configuration affects all environments, not just production. The file core/src/main/resources/logback.xml is packaged into the application and used in all environments (development, testing, and production). Setting these loggers to WARN level will make debugging difficult in development and testing environments where DEBUG-level logs are often needed.
Consider implementing environment-specific logging configuration using one of these approaches:
- Use Spring profiles with logback-spring.xml and conditional configuration based on active profiles
- Create separate logback configuration files for different environments (e.g., logback-prod.xml, logback-dev.xml)
- Use environment variables or system properties to configure log levels dynamically
The current approach will suppress potentially useful DEBUG logs in all environments, which contradicts the PR title suggesting this is "for production image" only.
See JIRA issue: GSMFP-33.