-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create global log4j config #23631
Comments
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
### Proposed Changes Issue #23631 * Add global log4j2 configuration * default log4j2.configurationFile set in tomcat setenv.sh * default Log4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector * This provides a single context and is not based on the classloader * created lib folder for logging jars and added to tomcat classpath * moved redis session manager jars into their own folder * Normalized maven dependencies to help with debugging and versions centrally specified in bom * Removed log4j reloading functionality As well as using a common configuration for tomcat and webapp logs. This also resolves an inconsistency when The logging class is referenced in code before the ContextLifecycleListener is called. Previously the wrong configuration contained in the resources classpath of the ant-tooling jar was picked up initially. Tests * Test tomcat log messages are output to the same location * Test any issues with logging from plugins * Test ability to override log4j config and change log levels for core tomcat classes, webapp classes and plugin classes. currently can map to /srv/OVERRIDE/WEB-INF/log4j in container or update CATALINA_OPTS to include -Dlog4j2.configurationFile={path to file} * Test session manager functionality is not broken * Will need a review of the logging behavior from cloud engineering when this image is applied into our cloud environment including any log-level changes they may want to have by default ### Further changes There is follow up work to this PR that improves the way that the config can be specified and overridden. This change maintains the existing config file behavior but just applies it across the entire application. ### Checklist - [ ] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info This PR resolves #23631 (create global log4j config). ### Screenshots Original | Updated :-------------------------:|:-------------------------: ** original screenshot ** | ** updated screenshot **
… (#29746) ### Proposed Changes * Fix classloader issue with session manager introduced in PR #29694 * Use CATALINA_HOME in setenv scripts instead of TOMCAT_HOME. The first is always available, the second is only set within the docker startup scripts Instructions for Log4j require the classes to be added to the system classloader when tomcat loads by adding to the main java CLASSPATH. These logging jars do not need to reference any of the tomcat jars the session manager jars do need to reference the tomcat jars e.g. catalina.jar in the main lib folder. This is what is called the common.loader and is defined in catalina.properties file. the session manager jars either need to be in a folder referenced in this common.loader property or as before dropped into the existing lib folder. There is no need to change the old behaviour at this time so we can just change the install location back.
From what I can tell... This is in perfect shape
|
Currently Tomcat has its own logging and Log4j only initialises when the webapp starts up. This makes it hard to track issues especially in our k8s environments.
This task is to setup tomcat to use log4j2 for its logging and to use the same single context for the webapp allowing for a single log4j config file to handle the whole running of the application.
There is an existing proof of concept but it was causing some tests to fail. We need to merge in these changes into the core
#23964
The text was updated successfully, but these errors were encountered: