-
+
Server Configuration
This parameter allows messages sent to
stderr>,
- and CSV logs, to be
+ and CSV logs, to be
captured and redirected into log files.
This method, in combination with logging to
stderr>,
is often more useful than
might not appear in
syslog> output (a common example
is dynamic-linker failure messages).
This parameter can only be set at server start.
- logging_collector must be enabled to generate
- CSV logs.
+ logging_collector must be enabled to generate
+ CSV logs.
file or on the server command line.
- If log_destination> is set to csvlog>,
- .csv> will be appended to the timestamped
- log_filename> to create the final log file name.
- (If log_filename ends in .log>, the suffix is overwritten.)
- In the case of the example above, the
+ If log_destination> is set to csvlog>,
+ .csv> will be appended to the timestamped
+ log_filename> to create the final log file name.
+ (If log_filename ends in .log>, the suffix is overwritten.)
+ In the case of the example above, the
file name will be server_log.1093827753.csv
Using the csvlog
- Including csvlog> in the log_destination> list
- provides a convenient way to import log files into a database table.
- Here is a sample table definition for storing csvlog output:
+ Including csvlog> in the log_destination> list
+ provides a convenient way to import log files into a database table.
+ Here is a sample table definition for storing csvlog output:
There are a few things you need to import csvlog files easily and
- automatically:
+ automatically:
Set log_rotation_size to 0 to disable
- size-based log rotation, as it makes the log filename difficult
- to predict.
+ size-based log rotation, as it makes the log filename difficult
+ to predict.
Set log_truncate_on_rotate = on so that old
- log data isn't mixed with the new in the same file.
+ log data isn't mixed with the new in the same file.
the same information twice. The COPY command commits all of
the data it imports at one time, and any single error will
cause the entire import to fail.
- If you import a partial log file and later import the file again
- when it is complete, the primary key violation will cause the
- import to fail. Wait until the log is complete and closed before
- import. This will also protect against accidently importing a
- partial line that hasn't been completely written, which would
- also cause the COPY to fail.
+ If you import a partial log file and later import the file again
+ when it is complete, the primary key violation will cause the
+ import to fail. Wait until the log is complete and closed before
+ import. This will also protect against accidently importing a
+ partial line that hasn't been completely written, which would
+ also cause the COPY to fail.