| <?xml version="1.0"?> |
| <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd"> |
| <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?> |
| <!-- $LastChangedRevision$ --> |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <modulesynopsis metafile="mod_journald.xml.meta"> |
| |
| <name>mod_journald</name> |
| <description>Provides "journald" ErrorLog provider</description> |
| <status>Extension</status> |
| <sourcefile>mod_journald.c</sourcefile> |
| <identifier>journald_module</identifier> |
| |
| <summary> |
| <p>This module provides "journald" ErrorLog provider. It allows logging |
| error messages and CustomLog/TransferLog via systemd-journald(8).</p> |
| </summary> |
| |
| <section id="structured"> |
| <title>Structured logging</title> |
| <p>Systemd-journald allows structured logging and therefore it is |
| possible to filter logged messages according to various variables. |
| Currently supported variables are: |
| </p> |
| <dl> |
| <dt><code>LOG</code></dt> |
| <dd>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.</dd> |
| <dt><code>REQUEST_HOSTNAME</code></dt> |
| <dd>Host, as set by full URI or Host: header in the request.</dd> |
| <dt><code>REQUEST_USER</code></dt> |
| <dd>If an authentication check was made, this gets set to the user |
| name.</dd> |
| <dt><code>REQUEST_USERAGENT_IP</code></dt> |
| <dd>The address that originated the request.</dd> |
| <dt><code>REQUEST_URI</code></dt> |
| <dd>The path portion of the URI, or "/" if no path provided.</dd> |
| <dt><code>SERVER_HOSTNAME</code></dt> |
| <dd>The hostname of server for which the log message has been |
| generated.</dd> |
| </dl> |
| |
| <p>These variables can be for example used to show only log messages |
| for particular URI using <code>journalctl</code>: |
| </p> |
| |
| <highlight>journalctl REQUEST_URI=/index.html -a</highlight> |
| |
| <p>For more examples, see systemd-journalctl documentation.</p> |
| </section> |
| |
| <section id="examples"> |
| <title>Examples</title> |
| |
| <p>Using <code>journald</code> in ErrorLog directive (see <module>core</module>) |
| instead of a filename enables logging via systemd-journald(8) |
| if the system supports it. |
| </p> |
| |
| <highlight language="config"> |
| ErrorLog journald |
| </highlight> |
| |
| <p>Using <code>journald</code> as an error log provider in CustomLog |
| directive (see <module>mod_log_config</module>) enables |
| logging via systemd-journald(8) if the system supports it. |
| </p> |
| |
| <highlight language="config"> |
| CustomLog "journald" "%h %l %u %t \"%r\" %>s %b" |
| </highlight> |
| |
| <note type="warning"><title>Performance warning</title><p> |
| Currently, systemd-journald is not designed for high-throughput logging |
| and logging access_log to systemd-journald could decrease the performance |
| a lot. |
| </p></note> |
| |
| </section> |
| |
| </modulesynopsis> |