Red Hat Bugzilla – Bug 1134034
RFE: Need a "parallel" logging option in logshifter to log using both file and syslog
Last modified: 2014-10-02 09:59:45 EDT
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
FYI, the latest logshifter code is in origin-server: https://github.com/openshift/origin-server/tree/master/logshifter. This seems reasonable to me.
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.
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.
Just throwing in my +1 here: a narrowly-scoped combined option would be useful and straightforward to introduce.
Created a PR with multi_writer changes here: https://github.com/openshift/origin-server/pull/5758
PR was tested and merged last week. What are the next steps to get this into OSE?
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.
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
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
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