Mixing syslog configs leads to logging chaos

Bug #1473479 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenSRF
Fix Released
Wishlist
Unassigned

Bug Description

OpenSRF 2.4 / affects all versions.

Applications running together atop OpenSRF with conflicting syslog configurations can lead to inconsistent logging. This happens, for example, when running SIPServer with Evergreen. Each has its own syslog configuration, leading to inconsistent syslog formats (e.g. PID may or may not appear in the logs) and facility, depending on which component calls openlog() last. Logs start in one place and end up somewhere else.

I propose to give OpenSRF a toggle which tells it to avoid modifying syslog if it has been (or will be) managed from another context. This may be best handled with an environment variable (OSRF_ADOPT_SYSLOG) which, when set, tells Logger.pm to avoid any calls to openlog() and closelog() and to avoid overwriting the syslog facility when calling syslog().

(Note, I was unable to find any tool within syslog itself to detect if openlog has already been called).

With this, you might start SIP like so:

OSRF_ADOPT_SYSLOG=1 oils_ctl.sh -a start_sip

Here, SIPServer makes the initial openlog() call, then all SIP logs and Evergreen/OpenSRF client logs (running from within SIPServer) go to the same place and have the same syslog ident and facility.

Branch en route.

Tags: pullrequest
Revision history for this message
Bill Erickson (berick) wrote :
tags: added: pullrequest
Changed in opensrf:
milestone: none → 2.4.1
assignee: Bill Erickson (berick) → nobody
Galen Charlton (gmc)
Changed in opensrf:
milestone: 2.4.1 → 2.4.2
Galen Charlton (gmc)
Changed in opensrf:
milestone: 2.4.2 → 2.5-alpha
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master for inclusion in 2-5-alpha. Thanks, Bill!

Changed in opensrf:
status: Confirmed → Fix Committed
Galen Charlton (gmc)
Changed in opensrf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.