2be4d81c119e83387a5e1712f666cec8adaa19db
[freeradius.git] / raddb / modules / linelog
1 # -*- text -*-
2 #
3 #  $Id$
4
5 #
6 #  The "linelog" module will log one line of text to a file.
7 #  Both the filename and the line of text are dynamically expanded.
8 #
9 #  We STRONGLY suggest that you do not use data from the
10 #  packet as part of the filename.
11 #
12 linelog {
13         #
14         #  The file where the logs will go.
15         #
16         #  If the filename is "syslog", then the log messages will
17         #  go to syslog.
18         filename = ${logdir}/linelog
19
20         #
21         #  The Unix-style permissions on the log file.
22         #
23         #  Depending on format string, the log file may contain secret or
24         #  private information about users.  Keep the file permissions as
25         #  restrictive as possible.
26         permissions = 0600
27
28         #
29         #  The default format string.
30         format = "This is a log message for %{User-Name}"
31
32         #
33         #  This next line can be omitted.  If it is omitted, then
34         #  the log message is static, and is always given by "format",
35         #  above.
36         #
37         #  If it is defined, then the string is dynamically expanded,
38         #  and the result is used to find another configuration entry
39         #  here, with the given name.  That name is then used as the
40         #  format string.
41         #
42         #  If the configuration entry cannot be found, then no log
43         #  message is printed.
44         #
45         #  i.e. You can have many log messages in one "linelog" module.
46         #  If this two-step expansion did not exist, you would have
47         #  needed to configure one "linelog" module for each log message.
48
49         #
50         #  Reference the Packet-Type (Access-Request, etc.)  If it doesn't
51         #  exist, reference the "format" entry, above.
52         reference = "%{%{Packet-Type}:-format}"
53
54         #
55         #  Followed by a series of log messages.
56         Access-Request = "Requested access: %{User-Name}"
57         Access-Reject = "Rejected access: %{User-Name}"
58         Access-Challenge = "Sent challenge: %{User-Name}"
59
60         #
61         #  The log messages can be grouped into sections and
62         #  sub-sections, too.  The "reference" item needs to have a "."
63         #  for every section.  e.g. reference = foo.bar will reference
64         #  the "foo" section, "bar" configuration item.
65         #
66
67         #
68         #  Used if:     reference = "foo.bar".
69         foo {
70             bar = "Example log.  Please ignore"
71         }
72
73         #
74         #  Another example:
75         #      reference = "Accounting-Request.%{%{Acct-Status-Type}:-unknown}"
76         #
77         Accounting-Request {
78                 Start = "Connect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address})"
79                 Stop = "Disconnect: [%{User-Name}] (did %{Called-Station-Id} cli %{Calling-Station-Id} port %{NAS-Port} ip %{Framed-IP-Address}) %{Acct-Session-Time} seconds"
80
81                 #  Don't log anything for these packets.
82                 Alive = ""
83
84                 Accounting-On = "NAS %C (%{NAS-IP-Address}) just came online"
85                 Accounting-Off = "NAS %C (%{NAS-IP-Address}) just went offline"
86
87                 # don't log anything for other Acct-Status-Types.
88                 unknown = ""
89         }
90
91 }