Table of Contents Previous Next


9 Log Manager

You can use the PEM Log Manager to simplify server log configuration for Postgres instances. With the Log Manager, you can modify all of your server log parameters with a click:
To open the Log Manager, select the Log Manager… option from the Management menu of the PEM client. The wizard opens, welcoming you to the Log Manager (as shown in Figure 9.1).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\d95d6c12\lmone.png
Click Next to continue to the Servers dialog (see Figure 9.2).
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\962bf6ee\lmtwo.png
The Servers dialog displays a list of the server connections monitored by PEM. Only those servers that specify a Service ID on the Advanced tab of the Properties dialog are active. Check the box next to the name of a server (or servers) to which the Log Manager wizard will apply the specified configuration.
Click Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\c9d65d4e\lmthree.png
Use the options on the Scheduling dialog (as shown in Figure 9.3) to schedule log file import frequency, and to select a time that logging configuration changes will be applied.
Options within the Import Logs box specify how often log files will be imported to PEM:
Check the box next to the Import logs to PEM label to specify that log files will be imported to PEM, and displayed on the Server Log Analysis dashboard.
Use the Import Frequency drop-down list box to specify how often log files are imported to PEM.
Use the fields in the Log Rotation Configuration panel to specify the maximum length (lifespan or size) of a log file:
Use the Rotation Size field to specify the maximum size in megabytes of an individual log file. The default value is 10 MB; when set to 0, no limit is placed on the maximum size of a log file.
Use the Rotation Time field to specify the number of whole days that should be stored in each log file. The default value is 1 day.
Use the Truncation on Rotation radio buttons to specify server behavior for time-based log file rotation:
Select ON to specify that the server should overwrite any existing log file that has the same name that a new file would take.
Select OFF to specify that the server should append any new log file entries to an existing log file with the same name that a new log file would take. This is the default behavior.
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\485cd7d3\lmfour.png
Use the fields on the Where to Log dialog (shown in Figure 9.4) to specify where log files should be written.
Select an option from the Log Destination box to specify a destination for the server log output:
o
Check the box next to stderr to specify that log files should be written to stderr.
o
Check the box next to csvlog to specify that log files should be written to file in a comma-separated value format. This option is automatically enabled (and no longer editable) if you have selected Import logs to PEM on the Schedule dialog; if you are not importing server log files to PEM, this option is editable.
o
Check the box next to syslog to specify that log files should be written to the system log files.
o
On Windows, check the box next to eventlog to specify that log files should be written to the event log.
Use the Log Collector radio buttons to instruct the server to re-direct captured log messages (directed to STDERR) into log files.
Use the Log Silent Mode radio buttons to instruct the server to run silently in the background, disassociated from the controlling terminal.
Use the Log File Name field to specify a format for the log file name. By default, the format is enterprisedb-%Y-%m-%d_%H%M%S, where:
enterprisedb is the file name prefix
Y is the year that the log was stored
m is the month that the log was stored
d is the day that the log was stored
H is the hour that the log was stored
M is the minute that the log was stored
S is the second that the log was stored
When logging to syslog is enabled:
You can use the Syslog Facility drop-down list box to specify which syslog facility should be used.
You can use the Syslog Ident field to specify the program name that will identify Advanced Server entries in system logs.
Click Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\94aaf9e8\lmfive.png
Use the fields on the When to Log dialog (shown in Figure 9.5) to specify which events will initiate a log file entry. The severity levels (in order of severity, from most severe to least severe) are:
panic - Errors that cause all database sessions to abort.
fatal - Errors that cause a session to abort.
log - Information messages of interest to administrators.
error - Errors that cause a command to abort.
warning - Error conditions in which a command will complete but may not perform as expected.
notice - Items of interest to users. This is the default.
info - Information implicitly requested by the user.
debug5 through debug1 - Detailed debugging information useful to developers.
Use the Client Min Messages drop-down list box to specify which severity levels are sent to the client application.
Use the Log Min Messages drop-down list box to specify which severity levels are written to the server log.
By default, when an error message is written to the server log, the text of the SQL statement that initiated the log entry is not included. Use the Log Min Error Statement drop-down list box to specify a severity level that will trigger SQL statement logging. If a message is of the specified severity or higher, the SQL statement that produced the message will be written to the server log.
Use the Log Min Duration Statement drop-down list box to specify a statement duration (in milliseconds); any statements that exceed the specified number of milliseconds will be written to the server log. A value of -1 disables all duration-based logging; a value of 0 logs all statements and their duration.
Use the Log Temp Files field to specify a file size in kilobytes; when a temporary file reaches the specified size, it will be logged. A value of -1 (the default) disables this functionality.
Use the Auto Vacuum Min Duration field to specify a time length in milliseconds; if auto-vacuuming exceeds the length of time specified, the activity will be logged. A value of -1 (the default) disables this functionality.
Click Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\425dc969\lmsix.png
Use the fields on the What to Log dialog (shown in Figure 9.6) to specify log entry options that are useful for debugging and auditing.
The checkboxes in the Debug Options box instruct the server to include information in the log files related to query execution that may be of interest to a developer:
Check the box next to Parse Tree to instruct the server to include the parse tree in the log file.
Check the box next to Rewriter Output to instruct the server to include query rewriter output in the log file.
Check the box next to Execution Plan to instruct the server to include the execution plan for each executed query in the log file.
When the Indent Debug Options Output in Log option is enabled, the server indents each line that contains a parse tree entry, a query rewriter entry or query execution plan entry. While indentation makes the resulting log file more readable, it does result in a longer log file.
Use the options in the General Options box to instruct the server to include auditing information in the log file:
Check the box next to Checkpoints to include checkpoints and restartpoints in the server log.
Check the box next to Connections to include each attempted connection to the server (as well as successfully authenticated connections) in the server log.
Check the box next to Disconnections to include a server log entry for each terminated session that provides the session information and session duration.
Check the box next to Duration to include the amount of time required to execute each logged statement in the server log.
Check the box next to Hostname to include both the IP address and host name in each server log entry (by default, only the IP address is logged). Please note that this may cause a performance penalty.
Check the box next to Lock Waits to instruct the server to write a log entry for any session that waits longer than the time specified in the deadlock_timeout parameter to acquire a lock. This is useful when trying to determine if lock waits are the cause of poor performance.
Click Next to continue.

C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\505ef729\lmsix.png
Use the fields on the second What to Log dialog (shown in Figure 9.7) to specify the amount of information written to the log files.
Use the Error Verbosity drop-down list box to specify the detail written to each entry in the server log:
Select default to include the error message, DETAIL, HINT, QUERY and CONTEXT in each server log entry.
Select terse to log only the error message.
Select verbose to include the error message, the DETAIL, HINT, QUERY and CONTEXT error information, SQLSTATE error code and source code file name, the function name, and the line number that generated the error.
Use the Prefix String field to specify a printf-style string that is written at the beginning of each log file entry.
For information about the options supported, please see the log_line_prefix documentation (in the Postgres core documentation), available at:
Use the Statements drop-down list box to specify which SQL statements will be included in the server log. The default is none; valid options are:
Specify none to disable logging of SQL statements.
Specify ddl to instruct the server to log ddl (data definition language) statements, such as CREATE, ALTER, and DROP.
Specify mod to instruct the server to log all ddl statements, as well as all dml (data modification language) statements, such as INSERT, UPDATE, DELETE, TRUNCATE and COPY FROM.
Specify all to instruct the server to log all SQL statements.
Click Next to continue.
C:\Users\susan\AppData\Local\Temp\vmware-susan\VMwareDnD\0da25aa2\lmeight.png
Use options on the Schedule Config Changes dialog (see Figure 9.8) to specify when logging configuration changes will be applied:
Select the Configure Logging Now radio button to specify that the server will restart when you have completed the Log Manager wizard.
Select the Schedule it for some other time radio button to enable date and time list boxes; use the date and time selectors to specify a convenient time for the server to restart.
Click Finish to exit the wizard, and either restart the server, or schedule the server restart for the time specified on the scheduling dialog. You can use the Scheduled Tasks dialog to confirm that the configuration file update and server restart have been scheduled or performed as expected. To open the Scheduled Tasks dialog, right-click on the name of the selected server in the PEM client tree control, and select Scheduled Tasks...

9 Log Manager

Table of Contents Previous Next