bug #7085
closedcdmserver logfiles getting too big, use RollingFileAppender
100%
Description
cdmserver logfiles getting too big, use DailyRollingFileAppender
Keeping 7 daily logs should be sufficient since all logs are also preserved in the backupserver
Also delete all /var/log/cdmserver/out.log files once this is released.
see https://github.com/GoogleCloudPlatform/appengine-java-vm-runtime/issues/231
Configuring the logging consistently for the cdm-server and for all instances is complicated by the fact that the instances are running separately from the cdm-server in an own thread with own classloader for each instance. Therefore the root logger configured for the cdm-server is not being used by the instances.
TODO
- Setup the logging for the cdm-server so that the server and all instances are using the same DailyRollingFileAppender and logfile.
- remove FileAppenders configured in /opt/cdmserver/.cdmLibrary/log4j.properties of edit-test, edit-prod, edit-int, edit-demo-*, edit-jobber-1
- consider using log4j2, see #7821
- logfile paths in the cdm-server/src/main/resources/log4j.properties must not be hardcoded and platform-specific, like
log4j.appender.FILE.File= /var/log/cdmserver/cdmserver_log.out
- fixed by cdm-server|bb431d84
- On Configuring Jetty logging: https://www.eclipse.org/jetty/documentation/9.4.29.v20200521/configuring-logging.html
Solution
Jetty can be configured to use the Managed Diagnostic Context of either log4j or logback to centralize the logging from multiple webapps in to a central log file. This technique is explained in https://www.eclipse.org/jetty/documentation/9.4.29.v20200521/example-logging-logback-centralized.html for a jetty server which uses a deployment manager. In our situation of an embedded jetty which manages the cdm-webapp instance directly the configuration need to be a bit different, see eu.etaxonomy.cdm.server.logging.LoggingConfigurator
for details.
Consequences of this change:
- The cdm-server start option
logdir
has now been replanced by the system propertycdm.logDir
so all server installations need to checked and modified-logdir=... ==> -Dcdm.logDir=file://...
- adapt the docker configuration
- adapt the debian package?
- The system property
-Dlog4j.configuration=file://..
can no longer be used and needs to be replaced by e.g.:-Dlogback.configurationFile=file:/app/logback.xml
Related issues