File: log.rst

package info (click to toggle)
groonga 15.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 163,080 kB
  • sloc: ansic: 770,564; cpp: 48,925; ruby: 40,447; javascript: 10,250; yacc: 7,045; sh: 5,602; python: 2,821; makefile: 1,672
file content (272 lines) | stat: -rw-r--r-- 5,260 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
.. -*- rst -*-

Log
===

Groonga has two log files. They are process log and query
log. Process log is for all of :doc:`executables/groonga`
works. Query log is just for query processing.

.. _process-log:

Process log
-----------

Process log is enabled by default. Log path can be customized by
:option:`groonga --log-path` option. Each log has its log level. If a
log is smaller than Groonga process' log level, it's not logged. Log
level can be customized by :option:`groonga -l` or
:doc:`commands/log_level`.

Format
^^^^^^

Process log uses the following format::

  #{TIME_STAMP}|#{L}| #{MESSAGE}

Some multi-process based applications such as
:doc:`/reference/executables/groonga-httpd` and `PGroonga
<https://pgroonga.github.io/>`_ use the following format::

  #{TIME_STAMP}|#{L}|#{PID}: #{MESSAGE}

You can also show context ID that is also used in :ref:`query-log`. If
you also show context ID, you can associate related logs in
:ref:`process-log` and :ref:`query-log` easily::

  #{TIME_STAMP}|#{L}|#{PID}|#{CONTEXT_ID}: #{MESSAGE}

See :option:`groonga --log-flags` how to show PID, context ID and so
on.

Example::

  2011-07-05 08:35:09.276421|n| grn_init
  2011-07-05 08:35:09.276553|n| RLIMIT_NOFILE(4096,4096)

Example with PID::

  2011-07-05 08:35:09.276421|n|1129: grn_init
  2011-07-05 08:35:09.276553|n|1129: RLIMIT_NOFILE(4096,4096)

Example with PID and context ID::

  2025-01-27 16:39:40.709869|n|3901936|0x55788b59dbe0: grn_init: <14.0.9-27-gd6cd635>
  2025-01-27 16:39:40.710013|n|3901936|0x55788b59dbe0: vm.overcommit_memory kernel parameter should be 1: <0>: See INFO level log to resolve this
  2025-01-27 16:39:42.052517|n|3901936|0x55788b59dbe0: grn_fin (0)

``TIME_STAMP``
^^^^^^^^^^^^^^

It's time stamp uses the following format::

  YYYY-MM-DD hh:mm:ss.SSSSSS

.. list-table::
   :header-rows: 1

   * - Format
     - Description
   * - ``YYYY``
     - Year with four digits.
   * - ``MM``
     - Month with two digits.
   * - ``DD``
     - Day with two digits.
   * - ``hh``
     - Hour with two digits.
   * - ``mm``
     - Minute with two digits.
   * - ``ss``
     - Second with two digits.
   * - ``SSSSSS``
     - Microsecond with six digits.

Example::

  2011-07-05 06:25:18.345734

``L``
^^^^^

Log level with a character. Here is a character and log
level map.

.. list-table::
   :header-rows: 1

   * - Format
     - Description
   * - ``E``
     - Emergency
   * - ``A``
     - Alert
   * - ``C``
     - Critical
   * - ``e``
     - Error
   * - ``w``
     - Warning
   * - ``n``
     - Notification
   * - ``i``
     - Information
   * - ``d``
     - Debug
   * - ``-``
     - Dump

Example::

  E

``PID``
^^^^^^^

The process ID.

Example::

  1129

``MESSAGE``
^^^^^^^^^^^

Details about the log with free format.

Example::

  log opened.

.. _query-log:

Query log
---------

Query log is disabled by default. It can be enabled by
:option:`groonga --query-log-path` option.

Format
^^^^^^

Query log uses the following formats::

  #{TIME_STAMP}|#{MESSAGE}
  #{TIME_STAMP}|#{CONTEXT_ID}|#{QUERY_STATUS}#{QUERY}
  #{TIME_STAMP}|#{CONTEXT_ID}|#{QUERY_STATUS}#{ELAPSED_TIME} #{PROGRESS}
  #{TIME_STAMP}|#{CONTEXT_ID}|#{QUERY_STATUS}#{ELAPSED_TIME} #{RETURN_CODE}

Example::

  2011-07-05 06:25:19.458756|45ea3034|>select Properties --limit 0
  2011-07-05 06:25:19.458829|45ea3034|:000000000072779 select(19)
  2011-07-05 06:25:19.458856|45ea3034|:000000000099998 output(0)
  2011-07-05 06:25:19.458875|45ea3034|<000000000119062 rc=0
  2011-07-05 06:25:19.458986|45ea3034|>quit

``TIME_STAMP``
^^^^^^^^^^^^^^

It's time stamp uses the following format::

  YYYY-MM-DD hh:mm:ss.SSSSSS

.. list-table::
   :header-rows: 1

   * - Format
     - Description
   * - ``YYYY``
     - Year with four digits.
   * - ``MM``
     - Month with two digits.
   * - ``DD``
     - Day with two digits.
   * - ``hh``
     - Hour with two digits.
   * - ``mm``
     - Minute with two digits.
   * - ``ss``
     - Second with two digits.

``SSSSSS``
  Microsecond with six digits.

Example::

  2011-07-05 06:25:18.345734

``CONTEXT_ID``
^^^^^^^^^^^^^^

ID of a context. Groonga process creates contexts to process requests
concurrently. Each context outputs some logs for a request. This ID can
be used to extract a log sequence by a context.

Example::

  45ea3034

``QUERY_STATUS``
^^^^^^^^^^^^^^^^

.. list-table::
   :header-rows: 1

   * - Format
     - Description
   * - ``>``
     - A character that indicates query is started.
   * - ``:``
     - A character that indicates query is processing.
   * - ``<``
     - A character that indicates query is finished.

``MESSAGE``
^^^^^^^^^^^

Details about the log with free format.

Example::

  query log opened.

``QUERY``
^^^^^^^^^

A query to be processed.

Example::

  select users --match_columns hobby --query music

``ELAPSED_TIME``
^^^^^^^^^^^^^^^^

Elapsed time in nanoseconds since query is started.

Example::

  000000000075770
  (It means 75,770 nanoseconds.)

``PROGRESS``
^^^^^^^^^^^^

A processed work at the time.

Example::

  select(313401)
  (It means that 'select' is processed and 313,401 records are remained.)

``RETURN_CODE``
^^^^^^^^^^^^^^^

A return code for the query.

Example::

  rc=0
  (It means return code is 0. 0 means GRN_SUCCESS.)