Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1209165

Summary: [RFE] Multiple ErrorLog directives
Product: Red Hat Enterprise Linux 8 Reporter: Pat Riehecky <riehecky>
Component: httpdAssignee: Tomas Korbar <tkorbar>
Status: CLOSED MIGRATED QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: aferreir, csieh, jorton, luhliari, misterbonnie, tkorbar
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 19:06:25 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1473733, 1562205, 1654421    

Description Pat Riehecky 2015-04-06 14:25:02 UTC
Description of problem:
Our central security team wants all our httpd error logs sent to their central syslogger.  I would like to keep my local log files for my review.

Since ErrorLog has the ability to send to syslog or to a local file, can the behavior be amended so that I can do both?  I can fix up rsyslog to not store the duplicate copies on my own.  

My end goal looks something like:

# my log files
ErrorLog logs/error_log
# logging via syslog
ErrorLog syslog:local7

Currently I am only able to set one destination for ErrorLog, being able to duplicate the targets would be helpful for me.

Version-Release number of selected component (if applicable):
 	httpd-2.4.6-31

How reproducible:100%


Steps to Reproduce:
1.Enter multiple ErrorLog directives
2.Generate an error
3.Note where it is logged

Actual results:
Only one ErrorLog used

Expected results:
Error logged to all listed locations

Additional info:

Comment 5 Joe Orton 2017-02-07 12:54:59 UTC
If this is still a priority for you can you file a support ticket?

Possibly this is something we could do for httpd >= 2.5.

Comment 7 Pat Riehecky 2017-02-07 14:45:09 UTC
Ticket opened

Comment 8 Joe Orton 2017-02-07 14:46:56 UTC
Thanks Pat.  I don't want to raise expectations too high here, it might be something that we can do in RHEL7 httpd, but we can look at it for the future.

Comment 10 Pat Riehecky 2018-10-03 17:01:37 UTC
Any news on this?

Comment 12 Pat Riehecky 2019-10-03 19:42:05 UTC
Just swinging back around on this one....

Comment 15 Joe Orton 2020-09-03 12:50:48 UTC
Moving to the RHEL8 backlog.  I have some ideas about how to implement this upstream, but it's quite a tricky one.

Comment 27 Tomas Korbar 2023-04-11 13:09:52 UTC
Hi Patrick,
Would the possibility to define both log file and syslog facility be sufficient to you?
like this:
ErrorLog "logs/error_log"
ErrorLog syslog:local6

Httpd would be logging both to syslog and file, but there would be limitation that there
can still be only one log file.

Thanks for any response.

Comment 28 Pat Riehecky 2023-04-13 14:02:06 UTC
My ideal world would be where I can set multiple logfiles and a syslog stream. ie:

ErrorLog "logs/error_log"
ErrorLog "logs/sitename.example.com/error_log"
ErrorLog syslog:local6

For my actual use case, one log file and a syslog stream would be sufficient. ie:
ErrorLog "logs/error_log"
ErrorLog syslog:local6

Comment 29 Tomas Korbar 2023-04-19 12:29:54 UTC
You will be able to achieve this with pipe to tee utility.

More specifically your multiple log files use case:
ErrorLog "logs/error_log"
ErrorLog "logs/sitename.example.com/error_log"
ErrorLog syslog:local6

Will look like:
ErrorLog "| /usr/bin/tee logs/error_log logs/sitename.example.com/error_log"
ErrorLog syslog:local6

Comment 30 Pat Riehecky 2023-04-20 19:21:33 UTC
So long as I can specify multiple elements, I'm fine with that.

I can confirm on CentOS Stream 9 (roughly RHEL 9.2) that whatever is the last element specified is the only one used currently.

Comment 32 RHEL Program Management 2023-09-21 18:52:07 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 33 RHEL Program Management 2023-09-21 19:06:25 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.