Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1134034

Summary: RFE: Need a "parallel" logging option in logshifter to log using both file and syslog
Product: OpenShift Container Platform Reporter: Eric Sauer <esauer>
Component: ContainersAssignee: Scott Dodson <sdodson>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 2.1.0CC: adellape, agoldste, anli, asimonel, bleanhar, dmace, erich, jialiu, jokerman, libra-onpremise-devel, lmeyer, mmccomas, pruan, sdodson, thunt
Target Milestone: ---Keywords: Upstream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: openshift-origin-logshifter-1.5.2.1-1 Doc Type: Enhancement
Doc Text:
Because node host administrators may want to have logging consolidated via Syslog while gear users may wish to have logs written to the application root directory, nodes now support log delivery to both Syslog and file output types at the same time. Administrators can set the 'outputType' in the /etc/openshift/logshifter.conf file on node hosts to 'multi', which results in logs being written to both 'file' and 'syslog'.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-02 13:59:45 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:
Embargoed:

Description Eric Sauer 2014-08-26 16:33:21 UTC
Description of problem:
Our customer has a requirement to log both to local files (for admins/developer use for debugging) and to syslog, so they can have a central logging server for security auditing. We would like to add a third configuration option for 'outputtype' with value 'parallel', which logs using both the FileWriter and SyslogWriter.

Version-Release number of selected component (if applicable):
OSE 2.1

Additional info:
I have implemented this for testing purposes at: https://github.com/etsauer/logshifter

Comment 3 Andy Goldstein 2014-08-26 17:08:14 UTC
FYI, the latest logshifter code is in origin-server: https://github.com/openshift/origin-server/tree/master/logshifter.

This seems reasonable to me.

Comment 4 Brenton Leanhardt 2014-08-26 17:34:10 UTC
Would we want to allow for the logshifter output type to be a list of writers?

Writing to both locations would involve setting 'outputType=syslog,file' instead of creating a new type of writer. Having admins put 'outputType=parallel' would sort of back us in the corner in the case of adding a third option (that could potentially be combined with the other two in some way).

We wouldn't necessarily need to do anything fancy right now though.  The implementation could largely be the same.  It could be as simple as checking for permutations of 'syslog,file' for the outputType setting.

Comment 5 Luke Meyer 2014-08-26 18:36:14 UTC
After a bit more discussion, I think the proposed approach is good. I don't think there is much need for options beyond syslog, file, and both; the purpose of logshifter isn't to be a generic log tool, just to deal with the inside-gear vs syslog dichotomy.

It may be possible to have syslog split logs back to the gear, but I suspect it's simpler in several ways to just complete this final option on logshifter.

Comment 6 Dan Mace 2014-08-26 18:43:03 UTC
Just throwing in my +1 here: a narrowly-scoped combined option would be useful and straightforward to introduce.

Comment 7 Eric Sauer 2014-08-26 20:07:55 UTC
Created a PR with multi_writer changes here: https://github.com/openshift/origin-server/pull/5758

Comment 8 Eric Sauer 2014-09-02 17:40:24 UTC
PR was tested and merged last week. What are the next steps to get this into OSE?

Comment 9 Luke Meyer 2014-09-02 19:02:29 UTC
Thanks for bumping this. Basically it is up to the OSE team to cherry-pick the changes into 2.1 (or decide to just wait for 2.2 to be released). Bumping priority so it'll be on our radar.

Comment 10 Scott Dodson 2014-09-04 20:30:00 UTC
Eric,

I'm looking over this and familiarizing myself with logshifter. I'll likely get a PR in for 2.1.7 in order to ensure QA has adequate time to test.

--
Scott

Comment 13 Anping Li 2014-09-10 02:52:00 UTC
Verified and pass on puddle-2-1-2014-09-09
set outputtype = file in logshifter.conf.
1) tailf /var/messages and check the log files under /var/lib/openshift/$uuid/app-root/. 
2) Gears logged into file. No gears logged into /var/log/messages.

set outputtype = syslog in logshifter.conf
1) tailf /var/message and check the log files under /var/lib/openshift/$uuid/app-root/. 
2) Gears logged into /var/log/messages. No gears logged into /var/lib/openshift/$uuid/app-root/logs

set outputtype = multi logshifter.conf
1) tailf /var/message and check the log files under /var/lib/openshift/$uuid/app-root/. 
2) Gears logged into /var/log/messages and /var/lib/openshift/$uuid/app-root/logs

Comment 15 errata-xmlrpc 2014-10-02 13:59:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1353.html