]> jfr.im git - irc/quakenet/snircd.git/blame - doc/readme.log
Merged revisions 59-76 via svnmerge from
[irc/quakenet/snircd.git] / doc / readme.log
CommitLineData
189935b1 1Older versions of ircd had no consistent way of logging various
2actions. Some things, such as G-lines, were written out to log files
3with names compiled into the server. Others could only be logged
4through syslog. Some required that their log files exist beforehand.
5Starting with u2.10.11, this situation has changed dramatically.
6
7All logging in the server is now unified through a single logging
8subsystem. Unfortunately, the server still does not generate all the
9logs that it could, and some more tuning is in store for the next
10major release of ircd. Nevertheless, the logs that are generated are
11far more consistent, and those log messages may be sent to a given
12file, to syslog, or even to online operators--or any combination of
13these three methods. This file is intended to describe configuration
14of the logging subsystem.
15
16All logs are classified by a "subsystem" and a "level." The subsystem
17is a major classification; each subsystem may be configured
18individually. The level classification is used to indicate how
19important the message is; subsystems may be configured to omit log
20messages with less than a certain importance--not unlike syslog.
21
22Levels
23
24Levels are used to classify the importance of various log messages.
25The most important level is the "CRIT" level; the least important is
26the "DEBUG" level. Each of the levels is also mapped to a
27corresponding syslog level, and some may even force generation of
28certain types of server notices. Each importance level is described
29below.
30
31 * CRIT - Used for very critical notifications, such as server
32 termination. This is mapped to the corresponding "CRIT" syslog
33 priority. This will also generate server notices to the "OLDSNO"
34 server notice mask.
35
36 * ERROR - Used to report important error conditions. This is mapped
37 to the corresponding "ERR" syslog priority.
38
39 * WARNING - Used to warn about certain conditions. This is mapped to
40 the corresponding "WARNING" syslog priority.
41
42 * NOTICE - Used for reporting important information. This is mapped
43 to the corresponding "NOTICE" syslog priority.
44
45 * TRACE - Used to tracing operation of the server. This is mapped to
46 the corresponding "INFO" syslog priority.
47
48 * INFO - Used for reporting unimportant but potentially useful
49 information. This is mapped to the corresponding "INFO" syslog
50 priority.
51
52 * DEBUG - Used for reporting debugging information. This is mapped
53 to the corresponding "DEBUG" syslog priority. This will also
54 generate server notices to the "DEBUG" server notice mask.
55
56Subsystems
57
58All of the subsystems are described below, along with their default
59logging configuration. There are no default log files to log to, and
60the default logging level is INFO (unless the server is compiled with
61debugging enabled)--this means that only notices of importance INFO or
62higher will be logged.
63
64 * SYSTEM - Used to report information that affects the server as a
65 whole. By default, log messages to this subsystem go nowhere.
66
67 * CONFIG - Used to report information concerning the configuration
68 file. By default, log messages to this subsystem go to the default
69 syslog facility, which defaults to "USER," and to the "OLDSNO"
70 server notice mask.
71
72 * OPERMODE - Used to report usage of /OPMODE and /CLEARMODE. By
73 default, log messages to this subsystem go to the "HACK4" server
74 notice mask.
75
76 * GLINE - Used to report usage of /GLINE, particularly BADCHANs. By
77 default, log messages to this subsystem go to the "GLINE" server
78 notice mask.
79
80 * JUPE - Used to report usage of /JUPE. By default, log messages to
81 this subsystem go to the "NETWORK" server notice mask.
82
83 * WHO - Used to report usage of the extended features of /WHO
84 (/WHOX). By default, log messages to this subsystem go nowhere.
85
86 * NETWORK - Used to report net junctions and net breaks. By default,
87 log messages to this subsystem go to the "NETWORK" server notice
88 mask.
89
90 * OPERKILL - Used to report usage of /KILL by IRC operators. By
91 default, log messages to this subsystem go nowhere.
92
93 * SERVKILL - Used to report usage of /KILL by other servers. By
94 default, log messages to this subsystem go nowhere.
95
96 * USER - Used to report user sign-ons and sign-offs. By default, log
97 messages to this subsystem go nowhere.
98
99 * OPER - Used to report usage of /OPER, either successfully or
100 unsuccessfully. By default, log messages to this subsystem go to
101 the "OLDREALOP" server notice mask.
102
103 * RESOLVER - Used to report error messages or other conditions from
104 the resolver and authentication system. By default, log messages
105 to this subsystem go nowhere.
106
107 * SOCKET - Used to report problems with sockets. By default, log
108 messages to this subsystem go nowhere.
109
110 * IAUTH - Used to report connects, disconnects and errors for the
111 IAuth authorization mechanism. By default, log messages to this
112 subsystem go to the "NETWORK" server notice mask.
113
114 * DEBUG - Used only when debugging is enabled. All log messages to
115 this subsystem go either to the console or to the debug log file
116 compiled into the server, as well as to the "DEBUG" server notice
117 mask. This is the only subsystem with a default log file.
118
119Configuration
120
121The true power of the logging subsystem comes from its extremely
122flexible configuration. The default server facility can be
123configured, as can the facility for each individual subsystem
124described above. Moreover, administrators can configure the server to
125log to specific files, send selected log messages to operators
126subscribed to any server notice mask, and even change the default log
127level for each subsystem.
128
129The logging subsystem has a set of tables mapping names to the
130numerical values used internally. Subsystems, levels, syslog
131facilities, and server notice masks are all configured using strings.
132These tables even include special strings, such as "DEFAULT" and
133"NONE." Each possible configuration piece is described below.
134
135Default Syslog Facility
136
137The IRC server has a default facility that it uses when sending log
138messages to syslog. The default facility may be overridden for each
139individual subsystem, but the default itself can be changed with an
140appropriate Feature entry in the configuration file. The facility
141normally defaults to "USER," but may be configured to be any of AUTH,
142CRON, DAEMON, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6,
143LOCAL7, LPR, MAIL, NEWS, USER, or UUCP. Some systems also have the
144AUTHPRIV facility. To configure this default, add a Feature line to
145the configuration file that looks like "LOG" = "<facility>";
146<facility> should be replaced with the string for the desired default
147syslog facility.
148
149Log Files
150
151Each subsystem may be configured to send its log messages to any
152single log file with a Feature entry like "LOG" = "<subsys>" "FILE"
153"<file>"; <subsys> should be replaced with one of the subsystem names
154described above, and <file> should be a file name for the log file.
155The file name may be relative to the server's data directory
156("DPATH"), or it may be an absolute path name. Note that if you're
157using chroot, these absolute path names will be relative to the
158server's root directory.
159
160Logging to Syslog
161
162By default, except for the CONFIG subsystem, no logs are sent to
163syslog. This can be overridden using an Feature entry like "LOG" =
164"<subsys>" "FACILITY" "<facility>"; <subsys>, as above, should be
165replaced with one of the subsystem names described above, and
166<facility> must be one of the facility strings mentioned under
167"Default Syslog Facility." The facility string may also be "NONE," to
168turn off syslog for that subsystem, and "DEFAULT," to use the server's
169default facility. Please don't confuse a DEFAULT facility with the
170default for a particular subsystem; only the CONFIG subsystem defaults
171to DEFAULT, whereas all the rest default to NONE.
172
173Logging via Server Notices
174
175Log messages can be sent to online IRC operators. Many subsystems
176actually default to this behavior, in fact. For security, log
177messages containing IP addresses or other extremely sensitive data
178will never be sent via server notices, but all others can be sent to a
179specific server notice mask. (For more information about server
180notice masks, please see doc/snomask.html.) The available mask names
181are OLDSNO, SERVKILL, OPERKILL, HACK2, HACK3, UNAUTH, TCPCOMMON,
182TOOMANY, HACK4, GLINE, NETWORK, IPMISMATCH, THROTTLE, OLDREALOP,
183CONNEXIT, and DEBUG. The special mask name "NONE" inhibits sending of
184server notices for a particular subsystem. The Feature entry for this
185configuration looks like "LOG" = "<subsys>" "SNOMASK" "<mask>"; again,
186<subsys> is one of the subsystems described above, and <mask> is one
187of the mask names.
188
189Setting Minimum Logging Level
190
191The minimum log level for a particular subsystem may be set with an
192Feature entry like "LOG" = "<subsys>" "LEVEL" "<level>"; here,
193<subsys> is yet again one of the subsystems described above, and
194<level> is one of the level names, also described above.