Skip to content

Commit 0772a0e

Browse files
committed
Document default log_nonblock values for different loggers
Resolves #2242
1 parent 6dc2447 commit 0772a0e

File tree

2 files changed

+29
-24
lines changed

2 files changed

+29
-24
lines changed

doc/reference/configuration/cfg_logging.rst

+26-22
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
* 6 – ``VERBOSE``
2222
* 7 – ``DEBUG``
2323

24-
By setting ``log_level``, you can enable logging of all classes below
25-
or equal to the given level. Tarantool prints its logs to the standard
24+
By setting ``log_level``, you can enable logging of all events with severities above
25+
or equal to the given level. Tarantool prints logs to the standard
2626
error stream by default, but this can be changed with the
2727
:ref:`log <cfg_logging-log>` configuration parameter.
2828

@@ -42,15 +42,15 @@
4242

4343
Since version 1.7.4.
4444
By default, Tarantool sends the log to the standard error stream
45-
(``stderr``). If ``log`` is specified, Tarantool can send the log to ...
45+
(``stderr``). If ``log`` is specified, Tarantool can send the log to a ...
4646

47-
* a file;
47+
* file;
4848

49-
* a pipe;
49+
* pipe;
5050

51-
* the system logger.
51+
* system logger.
5252

53-
The example below shows how to send the log to the ``tarantool.log`` file:
53+
The example below shows how to send logs to the ``tarantool.log`` file:
5454

5555
.. code-block:: lua
5656
@@ -95,8 +95,8 @@
9595
The setting can be 'syslog:', 'syslog:facility=...', 'syslog:identity=...',
9696
'syslog:server=...', or a combination.
9797

98-
* The ``syslog:identity`` setting is an arbitrary string which will be placed at
99-
the beginning of all messages. The default value is: tarantool.
98+
* The ``syslog:identity`` setting is an arbitrary string, which is placed at
99+
the beginning of all messages. The default value is "tarantool".
100100

101101
* The ``syslog:facility`` setting is currently ignored but will be used in the future.
102102
The value must be one of the `syslog <https://en.wikipedia.org/wiki/Syslog>`_
@@ -107,7 +107,7 @@
107107

108108
* The ``syslog:server`` setting is the locator for the syslog server.
109109
It can be a Unix socket path beginning with "unix:", or an ipv4 port number.
110-
The default socket value is: dev/log (on Linux) or /var/run/syslog (on Mac OS).
110+
The default socket value is: ``dev/log`` (on Linux) or ``/var/run/syslog`` (on macOS).
111111
The default port value is: 514, the UDP port.
112112

113113
When logging to a file, Tarantool reopens the log on `SIGHUP <https://en.wikipedia.org/wiki/SIGHUP>`_.
@@ -124,19 +124,23 @@
124124
.. confval:: log_nonblock
125125

126126
Since version 1.7.4.
127-
If ``log_nonblock`` equals true, Tarantool does not block during logging
127+
If ``log_nonblock`` equals **true**, Tarantool does not block during logging
128128
when the system is not ready for writing, and drops the message
129129
instead. If :ref:`log_level <cfg_logging-log_level>` is high, and many
130-
messages go to the log, setting ``log_nonblock`` to true may improve
130+
messages go to the log, setting ``log_nonblock`` to **true** may improve
131131
logging performance at the cost of some log messages getting lost.
132132

133-
This parameter has effect only if the output is going to "syslog:" or
134-
"pipe:".
133+
This parameter has effect only if :ref:`log <cfg_logging-log>` is
134+
configured to send logs to a pipe or system logger.
135+
The default ``log_nonblock`` value is **nil**, which means that
136+
blocking behavior corresponds to the logger type:
137+
138+
* **false** for ``stderr`` and file loggers.
139+
140+
* **true** for a pipe and system logger.
135141

136-
The default ``log_nonblock`` value is nil, which means that
137-
blocking behavior corresponds to the type of logger.
138142
This is a behavior change: in earlier versions of the Tarantool
139-
server, the default value was true.
143+
server, the default value was **true**.
140144

141145
| Type: boolean
142146
| Default: nil
@@ -150,7 +154,7 @@
150154
Since version 1.6.2.
151155
If processing a request takes longer than the given value (in seconds),
152156
warn about it in the log. Has effect only if :ref:`log_level
153-
<cfg_logging-log_level>` is more than or equal to 4 (WARNING).
157+
<cfg_logging-log_level>` is greater than or equal to 4 (WARNING).
154158

155159
| Type: float
156160
| Default: 0.5
@@ -166,13 +170,13 @@
166170
* 'plain' (the default), or
167171
* 'json' (with more detail and with JSON labels).
168172

169-
Here is what a log entry looks like after ``box.cfg{log_format='plain'}``:
173+
Here is what a log entry looks like if ``box.cfg{log_format='plain'}``:
170174

171175
.. code-block:: text
172176
173177
2017-10-16 11:36:01.508 [18081] main/101/interactive I> set 'log_format' configuration option to "plain"
174178
175-
Here is what a log entry looks like after ``box.cfg{log_format='json'}``:
179+
Here is what a log entry looks like if ``box.cfg{log_format='json'}``:
176180

177181
.. code-block:: text
178182
@@ -186,12 +190,12 @@
186190
"file": "builtin\/box\/load_cfg.lua",
187191
"line": 317}
188192
189-
The ``log_format='plain'`` entry has time, process id,
193+
The ``log_format='plain'`` entry has a time value, process ID,
190194
cord name, :ref:`fiber_id <fiber_object-id>`,
191195
:ref:`fiber_name <fiber_object-name_get>`,
192196
:ref:`log level <cfg_logging-log_level>`, and message.
193197

194-
The ``log_format='json'`` entry has the same things along with their labels,
198+
The ``log_format='json'`` entry has the same fields along with their labels,
195199
and in addition has the file name and line number of the Tarantool source.
196200

197201
Setting ``log_format`` to 'json' is illegal if the output is going to "syslog:".

doc/reference/reference_lua/log.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
Overview
1111
===============================================================================
1212

13-
The Tarantool server puts all diagnostic messages in a log file specified by
13+
The ``log`` module provides the event logging system for the Tarantool server.
14+
Tarantool puts all diagnostic messages in a log specified by
1415
the :ref:`log <cfg_logging-log>` configuration parameter. Diagnostic
1516
messages may be either system-generated by the server's internal code, or
16-
user-generated with the :samp:`log.{log_level_function_name}` function.
17+
user-generated using the dedicated functions: ``log.info()``, ``log.error()``, and so on.
1718

1819
As explained in the description of :ref:`log_format <cfg_logging-log_format>`
1920
configuration setting, there are two possible formats for log entries:

0 commit comments

Comments
 (0)