Apache – Understand the day in a life of an Apache log message in modern Linux system

apache-httpdlogssystemd

How does a day in a life of an Apache log message in modern systemd based Linux system look like? I would expect it to be something like that:

  1. Apache daemon writes a log message using syslog(3)
  2. this log message is written to /run/systemd/journal/dev-log
  3. systemd-journald reads the log message from
    /run/systemd/journal/dev-log
  4. systemd-journald writes it to /run/systemd/journal/syslog
  5. rsyslogd or syslog-ng listen on /run/systemd/journal/syslog,
    get the message and then process it based on their configuration

Am I missing something? Is it possible that Apache logs(for example access log messages) directly to files, bypassing the whole logging system altogether?

Best Answer

It depends on the Apache configuration. As documented in mod_log_config, CustomLog can be used to send logs directly a file or pipe them to a command. That command could in turn pipe the contents on to a syslog daemon or even into the systemd journal.

The not-yet-released Apache 2.5 allows logging directly to systemd via mod_journald.

Related Question