logging.xml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. ]>
  6. <!-- Note: Please use the following terminology:
  7. - daemon - one process (e.g. kea-dhcp4)
  8. - component - one piece of code within a daemon (e.g. libdhcp or hooks)
  9. - server - currently equal to daemon, but the difference will be more
  10. prominent once we add client or relay support
  11. - logger - one instance of isc::log::Logger
  12. - structure - an element in config file (e.g. "Dhcp4")
  13. Do not use:
  14. - module => daemon
  15. -->
  16. <chapter id="logging">
  17. <title>Logging</title>
  18. <section>
  19. <title>Logging Configuration</title>
  20. <para>
  21. During its operation Kea may produce many messages. They differ in
  22. severity (some are more important than others) and source (some are
  23. produced by specific components, e.g. hooks). It is useful to understand
  24. which log messages are needed and which are not and configure your
  25. logging appropriately. For example, debug level messages can be safely
  26. ignored in a typical deployment. They are, however, very useful when
  27. debugging a problem.
  28. </para>
  29. <para>
  30. The logging system in Kea is configured through the
  31. <replaceable>Logging</replaceable> structure in your configuration
  32. file. All daemons (e.g. DHCPv4 and DHCPv6 servers) will use the
  33. configuration in the <replaceable>Logging</replaceable> structure to see
  34. what should be logged and to where. This allows for sharing identical
  35. logging configuration between daemons.
  36. </para>
  37. <section>
  38. <title>Loggers</title>
  39. <para>
  40. Within Kea, a message is logged through an entity called a
  41. "logger". Different components log messages through different
  42. loggers, and each logger can be configured independently of
  43. one another. Some components, in particular the DHCP server
  44. processes, may use multiple loggers to log messages pertaining
  45. to different logical functions of the component. For example,
  46. the DHCPv4 server is using one logger for messages
  47. pertaining to packet reception and transmission, another
  48. logger for messages related to lease allocation and so on.
  49. Some of the libraries used by the Kea servers, e.g. libdhcpsrv
  50. or libhooks library, use their own loggers.
  51. </para>
  52. <para>
  53. Users implementing hooks libraries (code attached to the server at
  54. runtime) are responsible for creating the loggers used by those
  55. libraries. Such loggers should have unique names, different
  56. from the logger names used by Kea. In this way the
  57. messages emitted from the hooks library can be distingued from
  58. messages issued by the core Kea code. Unique names also allow
  59. the loggers to be configured independently of loggers used
  60. by Kea. Whenever it makes sense, a hook library can use multiple
  61. loggers to log messages pertaining to different logical parts
  62. of the library.
  63. </para>
  64. <para>
  65. In the <quote>Logging</quote> structure of a configuration file
  66. you can specify the configuration for zero or more loggers
  67. (including loggers used by the proprietary hooks libraries). If
  68. there are no loggers specified, the code will use default values which
  69. cause Kea to log messages on at least INFO severity to standard
  70. output.
  71. <!-- @todo: add reference to section about controlling default
  72. behavior with env. variables, after #3591 is merged. -->
  73. </para>
  74. <para>
  75. The three most important elements of a logger configuration
  76. are the <option>name</option> (the component that is
  77. generating the messages), the <option>severity</option>
  78. (what to log), and the <option>output_options</option>
  79. (where to log).
  80. </para>
  81. <section>
  82. <title>name (string)</title>
  83. <para>
  84. Each logger in the system has a name, the name being that of the
  85. component binary file using it to log messages. For instance, if you
  86. want to configure logging for the DHCPv4 server, you add an entry
  87. for a logger named <quote>kea-dhcp4</quote>. This configuration will
  88. then be used by the loggers in the DHCPv4 server, and all the
  89. libraries used by it (unless a library defines its own logger and
  90. there is specific logger configuration that applies to that logger).
  91. </para>
  92. <para>
  93. When diagnosing the problem with the server's operation, it is often
  94. desired to use the DEBUG logging level to obtain the verbose output
  95. from the server and libraries it uses. However, high verbosity may
  96. be an overkill for the logging system in cases when the server
  97. is processing high volume traffic. To mitigate this problem, Kea
  98. is using multiple loggers, which can be configured independently
  99. and which are responsible for logging messages from different
  100. functional parts of the server. If the user, trying to diagnose the
  101. problem, has a reasonably high confidence that the problem origins
  102. in a specific function of the server, or the problem is related
  103. to the specific type of operation, he may enable high verbosity
  104. only for the relevant logger, thus limiting the debug messages
  105. to the required minimum.
  106. </para>
  107. <para>
  108. The loggers are associated with a particular library or binary
  109. of Kea. However, each library or binary may (and usually does)
  110. include multiple loggers. For example, the DHCPv4 server binary
  111. contains separate loggers for: packet parsing, for dropped packets,
  112. for callouts etc. Each logger "derives" its configuration from the
  113. root logger. In the typical case, the root logger configuration
  114. is the only logging configuration specified in the configuration
  115. file. Creating a specific configuration for the selected logger,
  116. thus overriding the configuration settings specified in the
  117. root logger configuration, requires putting its configuration
  118. aside of the root logger's configuration with some of the
  119. parameters modified.
  120. </para>
  121. <para>
  122. To illustrate this, suppose you are using the DHCPv4 server
  123. with the root logger <quote>kea-dhcp4</quote> logging at the
  124. INFO level. In order to enable DEBUG verbosity for the DHCPv4
  125. packet drops, you must create configuration entry for the
  126. logger called <quote>kea-dhcp4.bad-packets</quote> and specify
  127. severity DEBUG for this logger. All other configuration
  128. parameters may be omited for this logger if the logger should
  129. use the default values specified in the root logger's
  130. configuration.
  131. </para>
  132. <!-- we don't support asterisk anymore.
  133. <para>
  134. One special case is that of a component name of <quote>*</quote>
  135. (asterisks), which is interpreted as <emphasis>any</emphasis>
  136. component. You can set global logging options by using this,
  137. including setting the logging configuration for a library
  138. that is used by multiple daemons (e.g. <quote>*.config</quote>
  139. specifies the configuration library code in whatever
  140. daemon is using it).
  141. </para> -->
  142. <para>
  143. If there are multiple logger specifications in the configuration
  144. that might match a particular logger, the specification with the
  145. more specific logger name takes precedence. For example, if there
  146. are entries for both <quote>kea-dhcp4</quote> and
  147. <quote>kea-dhcp4.dhcpsrv</quote>, the DHCPv4 server &mdash; and all
  148. libraries it uses that are not dhcpsrv &mdash; will log messages
  149. according to the configuration in the first entry
  150. (<quote>kea-dhcp4</quote>).
  151. </para>
  152. <para>
  153. Currently defined loggers are:
  154. </para>
  155. <itemizedlist>
  156. <listitem>
  157. <simpara><command>kea-dhcp4</command> - this is the root logger for
  158. the DHCPv4 server. All components used by the DHCPv4 server inherit
  159. the settings from this logger if there is no specialized logger
  160. provided.</simpara>
  161. </listitem>
  162. <listitem>
  163. <simpara><command>kea-dhcp4.bad-packets</command> - this is the
  164. logger used by the DHCPv4 server deamon for logging inbound client
  165. packets that were dropped or to which the server responded with a
  166. DHCPNAK. The allows adminstrators to configure a separate log
  167. output that contains only packet drop and reject entries.</simpara>
  168. </listitem>
  169. <listitem>
  170. <simpara><command>kea-dhcp4.callouts</command> - this logger is used
  171. to log messages pertaining to the callouts registration and execution
  172. for the particular hook point.
  173. </simpara>
  174. </listitem>
  175. <listitem>
  176. <simpara><command>kea-dhcp4.ddns</command> - this logger is used by
  177. the DHCPv4 server to log messages related to the Client FQDN and
  178. Hostname option processing. It also includes log messages
  179. related to the relevant DNS updates.</simpara>
  180. </listitem>
  181. <listitem>
  182. <simpara><command>kea-dhcp4.dhcp4</command> - this is the logger
  183. by the DHCPv4 server deamon to log basic operations.</simpara>
  184. </listitem>
  185. <listitem>
  186. <simpara><command>kea-dhcp4.dhcpsrv</command> - this is a base
  187. logger for the libdhcpsrv library.</simpara>
  188. </listitem>
  189. <listitem>
  190. <simpara><command>kea-dhcp4.hooks</command> - this logger is used
  191. to log messages related to management of hooks libraries, e.g.
  192. registration and deregistration of the libraries, and to the
  193. initialization of the callouts execution for various hook points
  194. within the DHCPv4 server.</simpara>
  195. </listitem>
  196. <listitem>
  197. <simpara><command>kea-dhcp4.hosts</command> - this logger is used
  198. within the libdhcpsrv and it logs messages related to the management
  199. of the DHCPv4 host reservations, i.e. retrieval of the resevations
  200. and adding new reservations.</simpara>
  201. </listitem>
  202. <listitem>
  203. <simpara><command>kea-dhcp4.leases</command> - this logger is used
  204. by the DHCPv4 server to log messages related to the lease allocation.
  205. The messages include detailed information about the allocated or
  206. offered leases, errors during the lease allocation etc.
  207. </simpara>
  208. </listitem>
  209. <listitem>
  210. <simpara><command>kea-dhcp4.options</command> - this logger is
  211. used by the DHCPv4 server to log messages related to processing
  212. of the options in the DHCPv4 messages, i.e. parsing options,
  213. encoding options into on-wire format and packet classification
  214. using options contained in the received packets.</simpara>
  215. </listitem>
  216. <listitem>
  217. <simpara><command>kea-dhcp4.packets</command> - this logger
  218. is mostly used to log messages related to transmission of the DHCPv4
  219. packets, i.e. packet reception and sending a response. Such messages
  220. include the information about the source and destination IP addresses
  221. and interfaces used to transmit packets. This logger is also used
  222. to log messages related to subnet selection, as this selection is
  223. usually based on the IP addresses and/or interface names, which can
  224. be retrieved from the received packet, even before the DHCPv4 message
  225. carried in the packet is parsed.
  226. </simpara>
  227. </listitem>
  228. <listitem>
  229. <simpara><command>kea-dhcp6</command> - this is the root logger for
  230. the DHCPv6 server. All components used by the DHCPv6 server inherit
  231. the settings from this logger if there is no specialized logger
  232. provided.</simpara>
  233. </listitem>
  234. <listitem>
  235. <simpara><command>kea-dhcp6.bad-packets</command> - this is the
  236. logger used by the DHCPv6 server deamon for logging inbound client
  237. packets that were dropped.</simpara>
  238. </listitem>
  239. <listitem>
  240. <simpara><command>kea-dhcp6.callouts</command> - this logger is used
  241. to log messages pertaining to the callouts registration and execution
  242. for the particular hook point.
  243. </simpara>
  244. </listitem>
  245. <listitem>
  246. <simpara><command>kea-dhcp6.ddns</command> - this logger is used by
  247. the DHCPv6 server to log messages related to the Client FQDN option
  248. processing. It also includes log messages related to the relevant
  249. DNS updates.</simpara>
  250. </listitem>
  251. <listitem>
  252. <simpara><command>kea-dhcp6.dhcp6</command> - this is the logger
  253. used DHCPv6 server deamon to log basic operations.</simpara>
  254. </listitem>
  255. <listitem>
  256. <simpara><command>kea-dhcp6.dhcpsrv</command> - this is a base
  257. logger for the libdhcpsrv library.</simpara>
  258. </listitem>
  259. <listitem>
  260. <simpara><command>kea-dhcp6.hooks</command> - this logger is used
  261. to log messages related to management of hooks libraries, e.g.
  262. registration and deregistration of the libraries, and to the
  263. initialization of the callouts execution for various hook points
  264. within the DHCPv6 server.</simpara>
  265. </listitem>
  266. <listitem>
  267. <simpara><command>kea-dhcp6.hosts</command> - this logger is used
  268. within the libdhcpsrv and it logs messages related to the management
  269. of the DHCPv6 host reservations, i.e. retrieval of the resevations
  270. and adding new reservations.</simpara>
  271. </listitem>
  272. <listitem>
  273. <simpara><command>kea-dhcp6.leases</command> - this logger is used
  274. by the DHCPv6 server to log messages related to the lease allocation.
  275. The messages include detailed information about the allocated or
  276. offered leases, errors during the lease allocation etc.
  277. </simpara>
  278. </listitem>
  279. <listitem>
  280. <simpara><command>kea-dhcp6.options</command> - this logger is
  281. used by the DHCPv6 server to log messages related to processing
  282. of the options in the DHCPv6 messages, i.e. parsing options,
  283. encoding options into on-wire format and packet classification
  284. using options contained in the received packets.</simpara>
  285. </listitem>
  286. <listitem>
  287. <simpara><command>kea-dhcp6.packets</command> - this logger
  288. is mostly used to log messages related to transmission of the DHCPv6
  289. packets, i.e. packet reception and sending a response. Such messages
  290. include the information about the source and destination IP addresses
  291. and interfaces used to transmit packets. This logger is also used
  292. to log messages related to subnet selection, as this selection is
  293. usually based on the IP addresses and/or interface names, which can
  294. be retrieved from the received packet, even before the DHCPv6 message
  295. carried in the packet is parsed.
  296. </simpara>
  297. </listitem>
  298. <listitem>
  299. <simpara><command>kea-dhcp-ddns</command> - this is the root logger for
  300. the kea-dhcp-ddns deamon. All components used by this deamon inherit
  301. the settings from this logger if there is no specialized logger
  302. provided.</simpara>
  303. </listitem>
  304. <listitem>
  305. <simpara><command>kea-dhcp-ddns.dhcpddns</command> - this is the logger
  306. used by the kea-dhcp-ddns deamon for logging configuration and global
  307. event information. This logger does not specify logging settings
  308. for libraries used by the deamon.</simpara>
  309. </listitem>
  310. <listitem>
  311. <simpara><command>kea-dhcp-ddns.dhcp-to-d2</command> - this is the logger
  312. used by the kea-dhcp-ddns deamon for logging information about events
  313. dealing with receving messages from the DHCP servers and adding them
  314. to the queue for processing.</simpara>
  315. </listitem>
  316. <listitem>
  317. <simpara><command>kea-dhcp-ddns.d2-to-dns</command> - this is the logger
  318. used by the kea-dhcp-ddns deamon for logging information about events
  319. dealing with sending and receiving messages with the DNS servers.
  320. </simpara>
  321. </listitem>
  322. </itemizedlist>
  323. <para>
  324. Note that user-defined hook libraries should not use any of those
  325. loggers, and should define new loggers with names that correspond to
  326. the libraries using them. Suppose that the user created the library called
  327. <quote>libpacket-capture</quote> to dump packets received and
  328. transmitted by the server to the file. The appropriate name for the
  329. logger could be <command>kea-dhcp4.packet-capture</command>. Note
  330. that the hook library implementor only specifies the second part
  331. of this name, i.e. <quote>packet-capture</quote>. The first part is
  332. a root logger name and is prepended by the Kea logging system.
  333. It is also important to note that since this new logger is a child
  334. of a root logger, it inherits the configuration from the root logger,
  335. unless there is a separate configuration entry for the child logger
  336. which overrides the default configuration.
  337. </para>
  338. <para>
  339. The list of loggers above excludes any loggers implemented in hooks
  340. libraries. Please consult the documentation of the specific hooks
  341. libraries for the names of loggers they define.
  342. </para>
  343. <para>Additional loggers may be defined in the future. The easiest
  344. way to find out the logger name is to configure all logging to go
  345. to a single destination and look for specific logger names. See
  346. <xref linkend="logging-message-format"/> for details.</para>
  347. </section>
  348. <section>
  349. <title>severity (string)</title>
  350. <para>
  351. This specifies the category of messages logged.
  352. Each message is logged with an associated severity which
  353. may be one of the following (in descending order of
  354. severity):
  355. </para>
  356. <itemizedlist>
  357. <listitem>
  358. <simpara> FATAL </simpara>
  359. </listitem>
  360. <listitem>
  361. <simpara> ERROR </simpara>
  362. </listitem>
  363. <listitem>
  364. <simpara> WARN </simpara>
  365. </listitem>
  366. <listitem>
  367. <simpara> INFO </simpara>
  368. </listitem>
  369. <listitem>
  370. <simpara> DEBUG </simpara>
  371. </listitem>
  372. </itemizedlist>
  373. <para>
  374. When the severity of a logger is set to one of these
  375. values, it will only log messages of that severity, and
  376. the severities above it. The severity may also be set to
  377. NONE, in which case all messages from that logger are
  378. inhibited.
  379. <!-- TODO: worded wrong? If I set to INFO, why would it show DEBUG which is literally below in that list? -->
  380. </para>
  381. </section>
  382. <section>
  383. <title>output_options (list)</title>
  384. <para>
  385. Each logger can have zero or more
  386. <option>output_options</option>. These specify where log
  387. messages are sent. These are explained in detail below.
  388. </para>
  389. <para>
  390. The other options for a logger are:
  391. </para>
  392. </section>
  393. <section>
  394. <title>debuglevel (integer)</title>
  395. <para>
  396. When a logger's severity is set to DEBUG, this value
  397. specifies what debug messages should be printed. It ranges
  398. from 0 (least verbose) to 99 (most verbose).
  399. </para>
  400. <!-- TODO: complete this sentence:
  401. The general classification of debug message types is
  402. TODO; there's a ticket to determine these levels, see #1074
  403. -->
  404. <para>
  405. If severity for the logger is not DEBUG, this value is ignored.
  406. </para>
  407. </section>
  408. </section>
  409. <section>
  410. <title>Output Options</title>
  411. <para>
  412. The main settings for an output option are the
  413. <option>destination</option> and a value called
  414. <option>output</option>, the meaning of which depends on
  415. the destination that is set.
  416. </para>
  417. <section>
  418. <title>destination (string)</title>
  419. <para>
  420. The destination is the type of output. It can be one of:
  421. </para>
  422. <itemizedlist>
  423. <listitem>
  424. <simpara> console </simpara>
  425. </listitem>
  426. <listitem>
  427. <simpara> file </simpara>
  428. </listitem>
  429. <listitem>
  430. <simpara> syslog </simpara>
  431. </listitem>
  432. </itemizedlist>
  433. </section>
  434. <section>
  435. <title>output (string)</title>
  436. <para>
  437. This value determines the type of output. There are several
  438. special values allowed here: <command>stdout</command> (messages
  439. are printed on standard output), <command>stderr</command>
  440. (messages are printed on stderr), <command>syslog</command> (messages
  441. are logged to syslog using default name, <command>syslog:name</command>
  442. (messages are logged to syslog using specified name). Any other
  443. value is interpreted as a filename that the logs should be written to.
  444. </para>
  445. <para>
  446. The other options for <option>output_options</option> are:
  447. </para>
  448. <!-- configuration of flush is not supported yet.
  449. <section>
  450. <title>flush (true of false)</title>
  451. <para>
  452. Flush buffers after each log message. Doing this will
  453. reduce performance but will ensure that if the program
  454. terminates abnormally, all messages up to the point of
  455. termination are output.
  456. </para>
  457. </section> -->
  458. <section>
  459. <title>maxsize (integer)</title>
  460. <para>
  461. Only relevant when destination is file, this is maximum
  462. file size of output files in bytes. When the maximum
  463. size is reached, the file is renamed and a new file opened.
  464. (For example, a ".1" is appended to the name &mdash;
  465. if a ".1" file exists, it is renamed ".2",
  466. etc.)
  467. </para>
  468. <para>
  469. If this is 0, no maximum file size is used.
  470. </para>
  471. <note>
  472. <simpara>
  473. Due to a limitation of the underlying logging library
  474. (log4cplus), rolling over the log files (from ".1" to
  475. ".2", etc) may show odd results: There can be
  476. multiple small files at the timing of roll over. This
  477. can happen when multiple processes try to roll
  478. over the files simultaneously.
  479. Version 1.1.0 of log4cplus solved this problem, so if
  480. this or higher version of log4cplus is used to build
  481. Kea, it shouldn't happen. Even for older versions
  482. it is normally expected to happen rarely unless the log
  483. messages are produced very frequently by multiple
  484. different processes.
  485. </simpara>
  486. </note>
  487. </section>
  488. <section>
  489. <title>maxver (integer)</title>
  490. <para>
  491. Maximum number of old log files to keep around when
  492. rolling the output file. Only relevant when
  493. <option>output</option> is <quote>file</quote>.
  494. </para>
  495. </section>
  496. </section>
  497. </section>
  498. <section>
  499. <title>Example Logger Configurations</title>
  500. <para>
  501. In this example we want to set the global logging to
  502. write to the console using standard output.
  503. </para>
  504. <screen><userinput>
  505. "Logging": {
  506. "loggers": [
  507. {
  508. "name": "kea-dhcp4",
  509. "output_options": [
  510. {
  511. "output": "stdout"
  512. }
  513. ],
  514. "severity": "WARN"
  515. }
  516. ]
  517. }
  518. </userinput>
  519. </screen>
  520. <para>In this second example, we want to store debug log messages
  521. in a file that is at most 2MB and keep up to 8 copies of old logfiles.
  522. Once the logfile grows to 2MB, it will be renamed and a new file
  523. file be created.</para>
  524. <screen><userinput>
  525. "Logging": {
  526. "loggers": [
  527. {
  528. "name": "kea-dhcp6",
  529. "output_options": [
  530. {
  531. "output": "/var/log/kea-debug.log",
  532. "maxver": 8,
  533. "maxsize": 204800,
  534. "destination": "file"
  535. }
  536. ],
  537. "severity": "DEBUG",
  538. "debuglevel": 99
  539. }
  540. ]
  541. }</userinput></screen>
  542. </section>
  543. </section>
  544. <section id="logging-message-format">
  545. <title>Logging Message Format</title>
  546. <para>
  547. Each message written to the configured logging
  548. destinations comprises a number of components that identify
  549. the origin of the message and, if the message indicates
  550. a problem, information about the problem that may be
  551. useful in fixing it.
  552. </para>
  553. <para>
  554. Consider the message below logged to a file:
  555. <screen>2014-04-11 12:58:01.005 INFO [kea-dhcp4.dhcpsrv/27456]
  556. DHCPSRV_MEMFILE_DB opening memory file lease database: type=memfile universe=4</screen>
  557. </para>
  558. <para>
  559. Note: the layout of messages written to the system logging
  560. file (syslog) may be slightly different. This message has
  561. been split across two lines here for display reasons; in the
  562. logging file, it will appear on one line.
  563. </para>
  564. <para>
  565. The log message comprises a number of components:
  566. <variablelist>
  567. <varlistentry>
  568. <term>2014-04-11 12:58:01.005</term>
  569. <!-- TODO: timestamp repeated even if using syslog? -->
  570. <listitem><para>
  571. The date and time at which the message was generated.
  572. </para></listitem>
  573. </varlistentry>
  574. <varlistentry>
  575. <term>INFO</term>
  576. <listitem><para>
  577. The severity of the message.
  578. </para></listitem>
  579. </varlistentry>
  580. <varlistentry>
  581. <term>[kea-dhcp4.dhcpsrv/27456]</term>
  582. <listitem><para>
  583. The source of the message. This comprises two elements:
  584. the Kea process generating the message (in this
  585. case, <command>kea-dhcp4</command>) and the component
  586. within the program from which the message originated
  587. (which is the name of the common library used by DHCP server
  588. implementations). The number after the slash is a process id
  589. (pid).
  590. </para></listitem>
  591. </varlistentry>
  592. <varlistentry>
  593. <term>DHCPSRV_MEMFILE_DB</term>
  594. <listitem><para>
  595. The message identification. Every message in Kea
  596. has a unique identification, which can be used as an
  597. index into the <ulink
  598. url="kea-messages.html"><citetitle>Kea Messages
  599. Manual</citetitle></ulink> (<ulink
  600. url="http://kea.isc.org/docs/kea-messages.html"
  601. />) from which more information can be obtained.
  602. </para></listitem>
  603. </varlistentry>
  604. <varlistentry>
  605. <term>opening memory file lease database: type=memfile universe=4</term>
  606. <listitem><para>
  607. A brief description.
  608. Within this text, information relating to the condition
  609. that caused the message to be logged will be included.
  610. In this example, the information is logged that the in-memory
  611. lease database backend will be used to store DHCP leases.
  612. </para></listitem>
  613. </varlistentry>
  614. </variablelist>
  615. </para>
  616. </section>
  617. <section>
  618. <title>Logging During Kea Startup</title>
  619. <para>
  620. The logging configuration is specified in the configuration file.
  621. However, when Kea starts, the file is not read until some way into the
  622. initialization process. Prior to that, the logging settings are
  623. set to default values, although it is possible to modify some
  624. aspects of the settings by means of environment variables. Note
  625. that in the absence of any logging configuration in the configuration
  626. file, the settings of (possibly modified) default configuration will
  627. persist while the program is running.
  628. </para>
  629. <para>
  630. The following environment variables can be used to control the
  631. behavio of logging during startup:
  632. </para>
  633. <variablelist>
  634. <varlistentry>
  635. <term>KEA_LOCKFILE_DIR</term>
  636. <listitem><para>
  637. Specifies a directory where the logging system should create its
  638. lock file. If not specified, it is
  639. <replaceable>prefix</replaceable>/var/run/kea, where
  640. <replaceable>prefix</replaceable> defaults to /usr/local.
  641. This variable must not end
  642. with a slash. There is one special value: "none", which
  643. instructs Kea to not create lock file at all. This may cause
  644. issues if several processes log to the same file.
  645. </para></listitem>
  646. </varlistentry>
  647. <varlistentry>
  648. <term>KEA_LOGGER_DESTINATION</term>
  649. <listitem><para>
  650. Specifies logging output. There are several special values.
  651. <variablelist>
  652. <varlistentry>
  653. <term>stdout</term>
  654. <listitem><para>
  655. Log to standard output.
  656. </para></listitem>
  657. </varlistentry>
  658. <varlistentry>
  659. <term>stderr</term>
  660. <listitem><para>
  661. Log to standard error.
  662. </para></listitem>
  663. </varlistentry>
  664. <varlistentry>
  665. <term>syslog<optional>:<replaceable>fac</replaceable></optional></term>
  666. <listitem><para>
  667. Log via syslog. The optional
  668. <replaceable>fac</replaceable> (which is
  669. separated from the word "syslog" by a colon)
  670. specifies the
  671. facility to be used for the log messages. Unless
  672. specified, messages will be logged using the
  673. facility "local0".
  674. </para></listitem>
  675. </varlistentry>
  676. </variablelist>
  677. Any other value is treated as a name
  678. of the output file. If not specified otherwise, Kea will log to
  679. standard output.
  680. </para></listitem>
  681. </varlistentry>
  682. </variablelist>
  683. </section>
  684. </chapter>