Bug 2024310

Summary: RFE: CustomLog should be able to use journald
Product: Red Hat Enterprise Linux 9 Reporter: Pat Riehecky <riehecky>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED CURRENTRELEASE QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: CentOS StreamCC: bnater, bstinson, csieh, gerald.prock, jlyle, jorton, jwboyer, kwalker, lkuprova, lmanasko, luhliari, misterbonnie, pasik, riehecky, rsawhill
Target Milestone: rcKeywords: FutureFeature, Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1209162 Environment:
Last Closed: 2021-11-18 08:41: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:
Embargoed:

Description Pat Riehecky 2021-11-17 19:25:52 UTC
I'm not showing these patches in Stream 9.

+++ This bug was initially created as a clone of Bug #1209162 +++

Description of problem:

mod_log_config doesn't allow to use syslog facility like this:

CustomLog syslog:local4

(like it's possible with ErroLog).

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


How reproducible:
100%

Steps to Reproduce:
1.Try to use the syslog syntax provided by ErrorLog on CustomLog
2.
3.

Actual results:
Does not work

Expected results:
Can use native syslog capabilities

Additional info:

--- Additional comment from Joe Orton on 2020-06-15 10:50:33 UTC ---

It does not appear to be feasible to backport syslog support for CustomLog.  However, I have found a way to backport journald support, though without the structured logging support used in upstream 2.5's mod_journald.

I am therefore adjusting the RFE to cover just journald.  mod_journald will be supported once there is a stable (e.g. 2.6) release which we can package as a new module stream.

--- Additional comment from Joe Orton on 2020-06-15 12:21:42 UTC ---

The syntax supported is:

  CustomLog journald:priority format|nickname

where "priority" is a priority string as in LogLevel http://httpd.apache.org/docs/2.4/mod/core.html#loglevel
Only priorities up to debug are permitted (the syslog/journald interfaces do not support trace* levels)

--- Additional comment from Branislav Náter on 2020-06-15 14:56:55 UTC ---

(In reply to Joe Orton from comment #28)
> The syntax supported is:
> 
>   CustomLog journald:priority format|nickname
> 
> where "priority" is a priority string as in LogLevel
> http://httpd.apache.org/docs/2.4/mod/core.html#loglevel
> Only priorities up to debug are permitted (the syslog/journald interfaces do
> not support trace* levels)

Were there any documentation backported?

--- Additional comment from Joe Orton on 2020-06-15 15:25:07 UTC ---

No; in fact overriding the priority level is not possible with the extensions to mod_log_config and mod_journald from trunk/2.5, which will always default to the INFO level for transfer logs (and maps error log levels to the appropriate level from httpd internal log level).

Not sure where best to document this, release notes is maybe sufficient?

--- Additional comment from errata-xmlrpc on 2020-11-04 03:35:12 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 (Moderate: httpd:2.4 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHSA-2020:4751

Comment 1 Joe Orton 2021-11-18 08:32:33 UTC
Nice catch Pat, thank you for reporting it.

Comment 2 Joe Orton 2021-11-18 08:41:20 UTC
Correction, sorry - the syslog: support for CustomLog is still not something we can easily do in 2.4.x and will have to wait for 2.6.

journald: support for CustomLog is present in the RHEL9 packages and works the same as RHEL8 (our tests confirm that).