Bug 1571365

Summary: [Logs] Disable karaf.log in container, log only to STDOUT (for 'docker log')
Product: Red Hat OpenStack Reporter: Michael Vorburger <vorburger>
Component: puppet-opendaylightAssignee: Janki <jchhatba>
Status: CLOSED WONTFIX QA Contact: Noam Manos <nmanos>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: aadam, jjoyce, jschluet, mkolesni, slinaber, trozet, tvignaud
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Logs
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-09 03:53:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1559055    
Bug Blocks:    

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.