Bug 1571365 - [Logs] Disable karaf.log in container, log only to STDOUT (for 'docker log')
Summary: [Logs] Disable karaf.log in container, log only to STDOUT (for 'docker log')
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: puppet-opendaylight
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 14.0 (Rocky)
Assignee: Janki
QA Contact: Noam Manos
Whiteboard: Logs
Depends On: 1559055
TreeView+ depends on / blocked
Reported: 2018-04-24 15:31 UTC by Michael Vorburger
Modified: 2019-01-09 03:53 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-01-09 03:53:20 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Michael Vorburger 2018-04-24 15:31:42 UTC
[based on email thread and partially copy/pasting from the reply by Tim Rozet]

Description of problem:

The OpenDaylight container currently logs to 2 places: karaf.log (which is mounted to somewhere outside of the container) and STDOUT (which the Docker container runtime feeds into journald; to access logs with ODL you can either do "docker logs opendaylight-api" OR you can use journalctl like "journalctl CONTAINER_NAME=opendaylight-api").

This double logging is at best slightly confusing for end-users, and at worst not ideal for performance.

TripleO services are moving to use docker logging based on stdout.  ODL is one of the first services to do this.  Other services mount their logs into /var/log/containers/ on the host.

From OSPD perspective, we only want 1 way for customers to access logging, this will be using docker logging and not karaf.log inside the container.

Actual results:

ODL logging is in BÒTH karaf.log* file(s) AND "docker logs opendaylight-api" (=  "journalctl CONTAINER_NAME=opendaylight-api").

Expected results:

The karaf.log only contains a few ODL start up log messages, and nothing after that; all other ongoing logging goes only to STDOUT = "docker logs opendaylight-api" = "journalctl CONTAINER_NAME=opendaylight-api".

Additional info:

The confusion in Bug 1559055 re. journald rotation should be cleared up BEFORE we make this change.

This change should affect only ODL in the container, not for the base RPM.

Comment 1 Michael Vorburger 2018-04-24 15:48:44 UTC
The way to technically do this has already been discussed in https://bugzilla.redhat.com/show_bug.cgi?id=1559055#c21 (which was technically about something else) :

Comment out "log4j2.rootLogger.appenderRef.RollingFile.ref = RollingFile" in /opt/opendaylight/etc/org.ops4j.pax.logging.cfg.

Comment 5 Janki 2019-01-09 03:53:20 UTC
Closing this as won't fix because docker is being replaced by Podman starting OSP15.

Note You need to log in before you can comment on or make changes to this bug.