Project

General

Profile

Actions

bug #7085

closed

cdmserver logfiles getting too big, use RollingFileAppender

Added by Andreas Kohlbecker over 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmserver
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
major
Found in Version:

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


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 property cdm.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

Related to EDIT - feature request #7819: Log4j.properties file is not properly packaged by the cdmserver install scriptNewAndreas Kohlbecker

Actions
Related to EDIT - feature request #7820: Add cron job for deleting cdmserver log files after a specified time periodRejectedAndreas Kohlbecker

Actions
Related to EDIT - feature request #6249: better logging strategyClosedAndreas Kohlbecker

Actions
Related to EDIT - bug #9236: stopping an instance breaks the centralized loggingClosedAndreas Kohlbecker

Actions
Has duplicate EDIT - feature request #7821: Use log4j2 for cdmserver logging to avoid having a separate cron job for deleting log filesDuplicateAndreas Kohlbecker

Actions
Has duplicate EDIT - bug #6287: Rolling cdmserver.log file only contains entries from startup phaseDuplicateAndreas Kohlbecker

Actions
Actions

Also available in: Atom PDF