File: runtime-config-logging.html

package info (click to toggle)
pgadmin3 1.4.3-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 29,796 kB
  • ctags: 10,758
  • sloc: cpp: 55,356; sh: 6,164; ansic: 1,520; makefile: 576; sql: 482; xml: 100; perl: 18
file content (496 lines) | stat: -rw-r--r-- 27,099 bytes parent folder | download
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>17.7.Error Reporting and Logging</title>
<link rel="stylesheet" href="stylesheet.css" type="text/css">
<link rev="made" href="pgsql-docs@postgresql.org">
<meta name="generator" content="DocBook XSL Stylesheets V1.70.0">
<link rel="start" href="index.html" title="PostgreSQL 8.1.4 Documentation">
<link rel="up" href="runtime-config.html" title="Chapter17.Server Configuration">
<link rel="prev" href="runtime-config-query.html" title="17.6.Query Planning">
<link rel="next" href="runtime-config-statistics.html" title="17.8.Run-Time Statistics">
<link rel="copyright" href="ln-legalnotice.html" title="Legal Notice">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="runtime-config-logging"></a>17.7.Error Reporting and Logging</h2></div></div></div>
<a name="id650358"></a><div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="runtime-config-logging-where"></a>17.7.1.Where To Log</h3></div></div></div>
<a name="id650379"></a><div class="variablelist"><dl>
<dt>
<a name="guc-log-destination"></a><span class="term"><code class="varname">log_destination</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        <span class="productname">PostgreSQL</span> supports several methods
         for logging server messages, including
         <span class="systemitem">stderr</span> and
         <span class="systemitem">syslog</span>. On Windows, 
         <span class="systemitem">eventlog</span> is also supported. Set this
         option to a list of desired log destinations separated by
         commas. The default is to log to <span class="systemitem">stderr</span> 
         only.
         This option can be set at server start or in the
         <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-redirect-stderr"></a><span class="term"><code class="varname">redirect_stderr</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>         This option allows messages sent to <span class="application">stderr</span> to be
         captured and redirected into log files.
         This option, in combination with logging to <span class="application">stderr</span>,
         is often more useful than
         logging to <span class="application">syslog</span>, since some types of messages
         may not appear in <span class="application">syslog</span> output (a common example
         is dynamic-linker failure messages).
         This option can only be set at server start.
       </p></dd>
<dt>
<a name="guc-log-directory"></a><span class="term"><code class="varname">log_directory</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        When <code class="varname">redirect_stderr</code> is enabled, this option
        determines the directory in which log files will be created.
        It may be specified as an absolute path, or relative to the
        cluster data directory.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-filename"></a><span class="term"><code class="varname">log_filename</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        When <code class="varname">redirect_stderr</code> is enabled, this option
        sets the file names of the created log files.  The value
        is treated as a <span class="systemitem">strftime</span> pattern,
        so <code class="literal">%</code>-escapes
        can be used to specify time-varying file names.
        If no <code class="literal">%</code>-escapes are present,
        <span class="productname">PostgreSQL</span> will
        append the epoch of the new log file's open time.  For example,
        if <code class="varname">log_filename</code> were <code class="literal">server_log</code>, then the
        chosen file name would be <code class="literal">server_log.1093827753</code>
        for a log starting at Sun Aug 29 19:02:33 2004 MST.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-rotation-age"></a><span class="term"><code class="varname">log_rotation_age</code> (<code class="type">integer</code>)</span>
</dt>
<dd><p>        When <code class="varname">redirect_stderr</code> is enabled, this option
        determines the maximum lifetime of an individual log file.
        After this many minutes have elapsed, a new log file will
        be created.  Set to zero to disable time-based creation of
        new log files.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-rotation-size"></a><span class="term"><code class="varname">log_rotation_size</code> (<code class="type">integer</code>)</span>
</dt>
<dd><p>        When <code class="varname">redirect_stderr</code> is enabled, this option
        determines the maximum size of an individual log file.
        After this many kilobytes have been emitted into a log file,
        a new log file will be created.  Set to zero to disable size-based
        creation of new log files.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-truncate-on-rotation"></a><span class="term"><code class="varname">log_truncate_on_rotation</code> (<code class="type">boolean</code>)</span>
</dt>
<dd>
<p>        When <code class="varname">redirect_stderr</code> is enabled, this option will cause
        <span class="productname">PostgreSQL</span> to truncate (overwrite),
        rather than append to, any existing log file of the same name.
        However, truncation will occur only when a new file is being opened
        due to time-based rotation, not during server startup or size-based
        rotation.  When off, pre-existing files will be appended to in
        all cases.  For example, using this option in combination with
        a <code class="varname">log_filename</code> like <code class="literal">postgresql-%H.log</code>
        would result in generating twenty-four hourly log files and then
        cyclically overwriting them.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p>
<p>        Example:  To keep 7 days of logs, one log file per day named
        <code class="literal">server_log.Mon</code>, <code class="literal">server_log.Tue</code>, 
        etc, and automatically overwrite last week's log with this week's log,
        set <code class="varname">log_filename</code> to <code class="literal">server_log.%a</code>, 
        <code class="varname">log_truncate_on_rotation</code> to <code class="literal">on</code>, and 
        <code class="varname">log_rotation_age</code> to <code class="literal">1440</code>.
       </p>
<p>        Example: To keep 24 hours of logs, one log file per hour, but 
        also rotate sooner if the log file size exceeds 1GB, set 
        <code class="varname">log_filename</code> to <code class="literal">server_log.%H%M</code>, 
        <code class="varname">log_truncate_on_rotation</code> to <code class="literal">on</code>, 
        <code class="varname">log_rotation_age</code> to <code class="literal">60</code>, and 
        <code class="varname">log_rotation_size</code> to <code class="literal">1000000</code>.
        Including <code class="literal">%M</code> in <code class="varname">log_filename</code> allows
        any size-driven rotations that may occur to select a file name
        different from the hour's initial file name.
       </p>
</dd>
<dt>
<a name="guc-syslog-facility"></a><span class="term"><code class="varname">syslog_facility</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        When logging to <span class="application">syslog</span> is enabled, this option
        determines the <span class="application">syslog</span>
        &#8220;<span class="quote">facility</span>&#8221; to be used.  You may choose
        from <code class="literal">LOCAL0</code>, <code class="literal">LOCAL1</code>,
        <code class="literal">LOCAL2</code>, <code class="literal">LOCAL3</code>, <code class="literal">LOCAL4</code>,
        <code class="literal">LOCAL5</code>, <code class="literal">LOCAL6</code>, <code class="literal">LOCAL7</code>;
        the default is <code class="literal">LOCAL0</code>. See also the
        documentation of your system's
        <span class="application">syslog</span> daemon.
        This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-syslog-ident"></a><span class="term"><code class="varname">syslog_ident</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>         When logging to <span class="application">syslog</span> is enabled, this option
         determines the program name used to identify
         <span class="productname">PostgreSQL</span> messages in
         <span class="application">syslog</span> logs. The default is
         <code class="literal">postgres</code>.
         This option can be set at server start or in the
         <code class="filename">postgresql.conf</code> configuration file.
        </p></dd>
</dl></div>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="runtime-config-logging-when"></a>17.7.2.When To Log</h3></div></div></div>
<div class="variablelist"><dl>
<dt>
<a name="guc-client-min-messages"></a><span class="term"><code class="varname">client_min_messages</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        Controls which message levels are sent to the client.
        Valid values are <code class="literal">DEBUG5</code>,
        <code class="literal">DEBUG4</code>, <code class="literal">DEBUG3</code>, <code class="literal">DEBUG2</code>,
        <code class="literal">DEBUG1</code>, <code class="literal">LOG</code>, <code class="literal">NOTICE</code>,
        <code class="literal">WARNING</code>, <code class="literal">ERROR</code>, <code class="literal">FATAL</code>,
        and <code class="literal">PANIC</code>.  Each level
        includes all the levels that follow it.  The later the level,
        the fewer messages are sent.  The default is
        <code class="literal">NOTICE</code>.  Note that <code class="literal">LOG</code> has a different
        rank here than in <code class="varname">log_min_messages</code>.
       </p></dd>
<dt>
<a name="guc-log-min-messages"></a><span class="term"><code class="varname">log_min_messages</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        Controls which message levels are written to the server log.
        Valid values are <code class="literal">DEBUG5</code>, <code class="literal">DEBUG4</code>,
        <code class="literal">DEBUG3</code>, <code class="literal">DEBUG2</code>, <code class="literal">DEBUG1</code>,
        <code class="literal">INFO</code>, <code class="literal">NOTICE</code>, <code class="literal">WARNING</code>,
        <code class="literal">ERROR</code>, <code class="literal">LOG</code>, <code class="literal">FATAL</code>, and
        <code class="literal">PANIC</code>.  Each level includes all the levels that
        follow it.  The later the level, the fewer messages are sent
        to the log.  The default is <code class="literal">NOTICE</code>.  Note that
        <code class="literal">LOG</code> has a different rank here than in
        <code class="varname">client_min_messages</code>.
        Only superusers can change this setting.
       </p></dd>
<dt>
<a name="guc-log-error-verbosity"></a><span class="term"><code class="varname">log_error_verbosity</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        Controls the amount of detail written in the server log for each
        message that is logged.  Valid values are <code class="literal">TERSE</code>,
        <code class="literal">DEFAULT</code>, and <code class="literal">VERBOSE</code>, each adding more
        fields to displayed messages.
        Only superusers can change this setting.
       </p></dd>
<dt>
<a name="guc-log-min-error-statement"></a><span class="term"><code class="varname">log_min_error_statement</code> (<code class="type">string</code>)</span>
</dt>
<dd><p>        Controls whether or not the SQL statement that causes an error
        condition will also be recorded in the server log. All SQL
        statements that cause an error of the specified level or
        higher are logged.  The default is
        <code class="literal">PANIC</code> (effectively turning this feature
        off for normal use). Valid values are <code class="literal">DEBUG5</code>,
        <code class="literal">DEBUG4</code>, <code class="literal">DEBUG3</code>,
        <code class="literal">DEBUG2</code>, <code class="literal">DEBUG1</code>,
        <code class="literal">INFO</code>, <code class="literal">NOTICE</code>,
        <code class="literal">WARNING</code>, <code class="literal">ERROR</code>,
        <code class="literal">FATAL</code>, and <code class="literal">PANIC</code>.  For
        example, if you set this to <code class="literal">ERROR</code> then all
        SQL statements causing errors, fatal errors, or panics will be
        logged. Enabling this option can be helpful in tracking down
        the source of any errors that appear in the server log.
        Only superusers can change this setting.
       </p></dd>
<dt>
<a name="guc-log-min-duration-statement"></a><span class="term"><code class="varname">log_min_duration_statement</code> (<code class="type">integer</code>)</span>
</dt>
<dd><p>         Logs the statement and its duration on a single log line if its
         duration is greater than or equal to the specified number of
         milliseconds. Setting this to zero will print all statements
         and their durations. Minus-one (the default) disables the
         feature. For example, if you set it to <code class="literal">250</code>
         then all SQL statements that run 250ms or longer will be
         logged. Enabling this option can be useful in tracking down
         unoptimized queries in your applications. This setting is
         independent of <code class="varname">log_statement</code> and
         <code class="varname">log_duration</code>. Only superusers can change
         this setting.
        </p></dd>
<dt>
<a name="guc-silent-mode"></a><span class="term"><code class="varname">silent_mode</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        Runs the server silently. If this option is set, the server
        will automatically run in background and any controlling
        terminals are disassociated (same effect as
        <code class="command">postmaster</code>'s <code class="option">-S</code> option).
        The server's standard output and standard error are redirected
        to <code class="literal">/dev/null</code>, so any messages sent to them will be lost.
        Unless <span class="application">syslog</span> logging is selected or
        <code class="varname">redirect_stderr</code> is enabled, using this option
        is discouraged because it makes it impossible to see error messages.
       </p></dd>
</dl></div>
<p>        Here is a list of the various message severity levels used in
        these settings:
        </p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="literal">DEBUG[1-5]</code></span></dt>
<dd><p>            Provides information for use by developers.
           </p></dd>
<dt><span class="term"><code class="literal">INFO</code></span></dt>
<dd><p>            Provides information implicitly requested by the user,
            e.g., during <code class="command">VACUUM VERBOSE</code>.
           </p></dd>
<dt><span class="term"><code class="literal">NOTICE</code></span></dt>
<dd><p>            Provides information that may be helpful to users, e.g.,
            truncation of long identifiers and the creation of indexes as part
            of primary keys.
           </p></dd>
<dt><span class="term"><code class="literal">WARNING</code></span></dt>
<dd><p>            Provides warnings to the user, e.g., <code class="command">COMMIT</code>
            outside a transaction block.
           </p></dd>
<dt><span class="term"><code class="literal">ERROR</code></span></dt>
<dd><p>            Reports an error that caused the current command to abort.
           </p></dd>
<dt><span class="term"><code class="literal">LOG</code></span></dt>
<dd><p>            Reports information of interest to administrators, e.g.,
            checkpoint activity.
           </p></dd>
<dt><span class="term"><code class="literal">FATAL</code></span></dt>
<dd><p>            Reports an error that caused the current session to abort.
           </p></dd>
<dt><span class="term"><code class="literal">PANIC</code></span></dt>
<dd><p>            Reports an error that caused all sessions to abort.
           </p></dd>
</dl></div>
<p>
       </p>
</div>
<div class="sect2" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="runtime-config-logging-what"></a>17.7.3.What To Log</h3></div></div></div>
<div class="variablelist"><dl>
<dt>
<span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="varname">debug_print_parse</code> (<code xmlns="" class="type">boolean</code>)</span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="varname">debug_print_rewritten</code> (<code xmlns="" class="type">boolean</code>)</span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span xmlns="http://www.w3.org/TR/xhtml1/transitional" class="term"><code xmlns="" class="varname">debug_print_plan</code> (<code xmlns="" class="type">boolean</code>)</span><br xmlns="http://www.w3.org/TR/xhtml1/transitional"></br><span class="term"><code class="varname">debug_pretty_print</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        These options enable various debugging output to be emitted.
        For each executed query, they print
        the resulting parse tree, the query rewriter output, or the
        execution plan.  <code class="varname">debug_pretty_print</code> indents
        these displays to produce a more readable but much longer
        output format.  <code class="varname">client_min_messages</code> or
        <code class="varname">log_min_messages</code> must be
        <code class="literal">DEBUG1</code> or lower to actually send this output
        to the client or the server log, respectively.
        These options are off by default.
       </p></dd>
<dt>
<a name="guc-log-connections"></a><span class="term"><code class="varname">log_connections</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        This outputs a line to the server log detailing each successful
        connection. This is off by default, although it is probably very
        useful.  Some client programs, like <span class="application">psql</span>, attempt 
        to connect twice while determining if a password is required, so 
        duplicate &#8220;<span class="quote">connection received</span>&#8221; messages do not
        necessarily indicate a problem. This option can only be set at
        server start or in the <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-disconnections"></a><span class="term"><code class="varname">log_disconnections</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        This outputs a line in the server log similar to
        <code class="varname">log_connections</code> but at session termination,
        and includes the duration of the session.  This is off by
        default. This option can be set at server start or in the
        <code class="filename">postgresql.conf</code> configuration file.
       </p></dd>
<dt>
<a name="guc-log-duration"></a><span class="term"><code class="varname">log_duration</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        Causes the duration of every completed statement which satisfies
        <code class="varname">log_statement</code> to be logged.  When using this option, 
        if you are not using <span class="application">syslog</span>, it is recommended 
        that you log the PID or session ID using <code class="varname">log_line_prefix</code> 
        so that you can link the statement message to the later
        duration message using the process ID or session ID. The default is
        <code class="literal">off</code>. Only superusers can change this setting.
       </p></dd>
<dt>
<a name="guc-log-line-prefix"></a><span class="term"><code class="varname">log_line_prefix</code> (<code class="type">string</code>)</span>
</dt>
<dd>
<p>         This is a <code class="function">printf</code>-style string that is output at the
         beginning of each log line. The default is an empty string.
         Each recognized escape is replaced as outlined 
         below - anything else that looks like an escape is ignored. Other
         characters are copied straight to the log line. Some escapes are
         only recognized by session processes, and do not apply to
         background processes such as the postmaster. <span class="application">Syslog</span>
         produces its own 
         time stamp and process ID information, so you probably do not want to
         use those escapes if you are using <span class="application">syslog</span>.
         This option can be set at server start or in the
         <code class="filename">postgresql.conf</code> configuration file.

         </p>
<div class="informaltable"><table border="1">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>Escape</th>
<th>Effect</th>
<th>Session only</th>
</tr></thead>
<tbody>
<tr>
<td><code class="literal">%u</code></td>
<td>User name</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%d</code></td>
<td>Database name</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%r</code></td>
<td>Remote host name or IP address, and remote port</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%h</code></td>
<td>Remote host name or IP address</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%p</code></td>
<td>Process ID</td>
<td>no</td>
</tr>
<tr>
<td><code class="literal">%t</code></td>
<td>Time stamp (no milliseconds)</td>
<td>no</td>
</tr>
<tr>
<td><code class="literal">%m</code></td>
<td>Time stamp with milliseconds</td>
<td>no</td>
</tr>
<tr>
<td><code class="literal">%i</code></td>
<td>Command tag: This is the command that generated the log line.</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%c</code></td>
<td>Session ID: A unique identifier for each session.
             It is 2 4-byte hexadecimal numbers (without leading zeros) 
             separated by a dot. The numbers
             are the session start time and the process ID, so this can also
             be used as a space saving way of printing these items.</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%l</code></td>
<td>Number of the log line for each process, starting at 1</td>
<td>no</td>
</tr>
<tr>
<td><code class="literal">%s</code></td>
<td>Session start time stamp</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%x</code></td>
<td>Transaction ID</td>
<td>yes</td>
</tr>
<tr>
<td><code class="literal">%q</code></td>
<td>Does not produce any output, but tells non-session
             processes to stop at this point in the string. Ignored by
             session processes.</td>
<td>no</td>
</tr>
<tr>
<td><code class="literal">%%</code></td>
<td>Literal <code class="literal">%</code>
</td>
<td>no</td>
</tr>
</tbody>
</table></div>
<p>
       </p>
</dd>
<dt>
<a name="guc-log-statement"></a><span class="term"><code class="varname">log_statement</code> (<code class="type">string</code>)</span>
</dt>
<dd>
<p>        Controls which SQL statements are logged. Valid values are
        <code class="literal">none</code>, <code class="literal">ddl</code>, <code class="literal">mod</code>, and
        <code class="literal">all</code>. <code class="literal">ddl</code> logs all data definition
        commands like <code class="literal">CREATE</code>, <code class="literal">ALTER</code>, and
        <code class="literal">DROP</code> commands. <code class="literal">mod</code> logs all
        <code class="literal">ddl</code> statements, plus <code class="literal">INSERT</code>,
        <code class="literal">UPDATE</code>, <code class="literal">DELETE</code>, <code class="literal">TRUNCATE</code>,
        and <code class="literal">COPY FROM</code>. <code class="literal">PREPARE</code> and
        <code class="literal">EXPLAIN ANALYZE</code> statements are also logged if their
        contained command is of an appropriate type.
       </p>
<p>        The default is <code class="literal">none</code>. Only superusers can change this
        setting.
       </p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>         The <code class="command">EXECUTE</code> statement is not considered a
         <code class="literal">ddl</code> or <code class="literal">mod</code> statement.  Statements that
         generate syntax errors are not logged.  Set
         <code class="varname">log_min_error_statement</code> to <code class="literal">error</code> to
         log such statements.      
        </p>
<p>         When a function is defined in the
         <span class="application">PL/pgSQL</span>server-side language, any queries
         executed by the function will only be logged the first time that the
         function is invoked in a particular session. This is because
         <span class="application">PL/pgSQL</span> keeps a cache of the
         query plans produced for the SQL statements in the function.
        </p>
</div>
</dd>
<dt>
<a name="guc-log-hostname"></a><span class="term"><code class="varname">log_hostname</code> (<code class="type">boolean</code>)</span>
</dt>
<dd><p>        By default, connection log messages only show the IP address of the
        connecting host. Turning on this option causes logging of the
        host name as well.  Note that depending on your host name resolution
        setup this might impose a non-negligible performance penalty. This
        option can be set at server start or in the
        <code class="filename">postgresql.conf</code> file.
       </p></dd>
</dl></div>
</div>
</div></body>
</html>