logging.xml 32 KB

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