TODO: Environment
=================
-.. function:: verbose(true | false)
+.. function:: user(name, [group])
+
+ :param string name: user name
+ :param string group: group name (optional)
+ :return: boolean
+
+ Drop privileges and start running as given user (and group, if provided).
+
+ .. tip:: Note that you should bind to required network addresses before changing user. At the same time, you should open the cache **AFTER** you change the user (so it remains accessible). A good practice is to divide configuration in two parts:
+
+ .. code-block:: lua
+
+ -- privileged
+ net.listen('127.0.0.1')
+ net.listen('::1')
+ user('knot-resolver', 'netgrp')
+ -- unprivileged
+ cache.size = 100*MB
+
+ Example output:
+
+ .. code-block:: lua
+
+ > user('baduser')
+ invalid user name
+ > user('knot-resolver', 'netgrp')
+ true
+ > user('root')
+ Operation not permitted
- :return: Toggle verbose logging.
.. function:: mode('strict' | 'normal' | 'permissive')
Unacceptable or missing glue records trigger resolution of names listed
in NS records before following respective delegation.
+
.. function:: reorder_RR([true | false])
:param boolean value: New value for the option *(optional)*
If set, resolver will vary the order of resource records within RR-sets.
It is disabled by default.
-.. function:: user(name, [group])
-
- :param string name: user name
- :param string group: group name (optional)
- :return: boolean
-
- Drop privileges and run as given user (and group, if provided).
-
- .. tip:: Note that you should bind to required network addresses before changing user. At the same time, you should open the cache **AFTER** you change the user (so it remains accessible). A good practice is to divide configuration in two parts:
-
- .. code-block:: lua
-
- -- privileged
- net = { '127.0.0.1', '::1' }
- -- unprivileged
- cache.size = 100*MB
- trust_anchors.add_file('root.key')
-
- Example output:
-
- .. code-block:: lua
-
- > user('baduser')
- invalid user name
- > user('knot-resolver', 'netgrp')
- true
- > user('root')
- Operation not permitted
-
-
.. _`JSON-encoded`: http://json.org/example
.. _`Learn Lua in 15 minutes`: http://tylerneylon.com/a/learn-lua/
panic("Use kresd@dns*, kresd@tls* or kresd@doh* instance names")
end
-.. include:: ../daemon/README.rst
-.. include:: ../daemon/bindings/modules.rst
+Logging, monitoring, diagnostics
+================================
+Knot Resolver logs to standard outputs, which is then captured by supervisor
+and sent to logging system for further processing.
+To read logs use commands usual for your distribution.
+E.g. on distributions using systemd-journald use command ``journalctl -u kresd@* -f``.
+
+During normal operation only errors and other very important events are logged,
+so by default logs from Knot Resolver should contain only couple lines a day.
+For debugging purposes it is possible to enable very verbose logging using
+:func:`verbose` function.
+
+.. function:: verbose([true | false])
+
+ :param: ``true`` to enable, ``false`` to disable verbose logging.
+ :return: boolean Current state of verbose logging.
+
+ Toggle global verbose logging. Use only for debugging purposes.
+ On busy systems vebose logging can produce several MB of logs per
+ second and will slow down operation.
+
+More fine-grained tools are available in following modules:
-Monitoring and diagnostics
-==========================
.. contents::
:depth: 1
:local:
+
.. include:: ../modules/nsid/README.rst
.. include:: ../modules/graphite/README.rst
.. include:: ../modules/dnstap/README.rst