]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_journald.xml
Merge in APR[-util] macros from branches/trunk-buildconf-noapr
[apache] / docs / manual / mod / mod_journald.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_journald.xml.meta">
24
25 <name>mod_journald</name>
26 <description>Provides "journald" ErrorLog provider</description>
27 <status>Extension</status>
28 <sourcefile>mod_journald.c</sourcefile>
29 <identifier>journald_module</identifier>
30
31 <summary>
32     <p>This module provides "journald" ErrorLog provider. It allows logging
33     error messages and CustomLog/TransferLog via systemd-journald(8).</p>
34 </summary>
35
36 <section id="structured">
37     <title>Structured logging</title>
38     <p>Systemd-journald allows structured logging and therefore it is
39     possible to filter logged messages according to various variables.
40     Currently supported variables are:
41     </p>
42     <dl>
43       <dt><code>LOG</code></dt>
44       <dd>The name of the log. For ErrorLog, the value is "error_log".
45           For CustomLog or TransferLog, the value is the first argument of
46           these directives.</dd>
47       <dt><code>REQUEST_HOSTNAME</code></dt>
48       <dd>Host, as set by full URI or Host: header in the request.</dd>
49       <dt><code>REQUEST_USER</code></dt>
50       <dd>If an authentication check was made, this gets set to the user
51           name.</dd>
52       <dt><code>REQUEST_USERAGENT_IP</code></dt>
53       <dd>The address that originated the request.</dd>
54       <dt><code>REQUEST_URI</code></dt>
55       <dd>The path portion of the URI, or "/" if no path provided.</dd>
56       <dt><code>SERVER_HOSTNAME</code></dt>
57       <dd>The hostname of server for which the log message has been
58           generated.</dd>
59     </dl>
60
61     <p>These variables can be for example used to show only log messages
62     for particular URI using <code>journalctl</code>:
63     </p>
64
65     <highlight>journalctl REQUEST_URI=/index.html -a</highlight>
66
67     <p>For more examples, see systemd-journalctl documentation.</p>
68 </section>
69
70 <section id="examples">
71     <title>Examples</title>
72
73     <p>Using <code>journald</code> in ErrorLog directive (see <module>core</module>)
74     instead of a filename enables logging via systemd-journald(8)
75     if the system supports it.
76     </p>
77
78     <highlight language="config">
79 ErrorLog journald
80     </highlight>
81
82     <p>Using <code>journald</code> as an error log provider in CustomLog
83     directive (see <module>mod_log_config</module>) enables
84     logging via systemd-journald(8) if the system supports it.
85     </p>
86
87     <highlight language="config">
88 CustomLog "journald" "%h %l %u %t \"%r\" %>s %b"
89     </highlight>
90
91     <note type="warning"><title>Performance warning</title><p>
92     Currently, systemd-journald is not designed for high-throughput logging
93     and logging access_log to systemd-journald could decrease the performance
94     a lot.
95     </p></note>
96
97 </section>
98
99 </modulesynopsis>