<-
Apache > HTTP Server > Documentation > Version 2.5 > Modules

Apache Module mod_journald

Available Languages:  en  |  fr 

Description:Provides "journald" ErrorLog provider
Status:Extension
Module Identifier:journald_module
Source File:mod_journald.c

Summary

This module provides "journald" ErrorLog provider. It allows logging error messages and CustomLog/TransferLog via systemd-journald(8).

Topics

Directives

This module provides no directives.

Bugfix checklist

See also

top

Structured logging

Systemd-journald allows structured logging and therefore it is possible to filter logged messages according to various variables. Currently supported variables are:

LOG
The name of the log. For ErrorLog, the value is "error_log". For CustomLog or TransferLog, the value is the first argument of these directives.
REQUEST_HOSTNAME
Host, as set by full URI or Host: header in the request.
REQUEST_USER
If an authentication check was made, this gets set to the user name.
REQUEST_USERAGENT_IP
The address that originated the request.
REQUEST_URI
The path portion of the URI, or "/" if no path provided.
SERVER_HOSTNAME
The hostname of server for which the log message has been generated.

These variables can be for example used to show only log messages for particular URI using journalctl:

journalctl REQUEST_URI=/index.html -a

For more examples, see systemd-journalctl documentation.

top

Examples

Using journald in ErrorLog directive (see core) instead of a filename enables logging via systemd-journald(8) if the system supports it.

ErrorLog journald

Using journald as an error log provider in CustomLog directive (see mod_log_config) enables logging via systemd-journald(8) if the system supports it.

CustomLog "journald" "%h %l %u %t \"%r\" %>s %b"

Performance warning

Currently, systemd-journald is not designed for high-throughput logging and logging access_log to systemd-journald could decrease the performance a lot.

Available Languages:  en  |  fr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to our mailing lists.