From: Darold Gilles Date: Fri, 8 May 2015 12:48:36 +0000 (+0200) Subject: Add app=%a default prefix to documentation. X-Git-Tag: v7.0~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a73941f08b1c78dca66bf26f5c0d4b48eed3bfdb;p=pgbadger Add app=%a default prefix to documentation. --- diff --git a/README b/README index 24ff8f6..2576b35 100644 --- a/README +++ b/README @@ -157,11 +157,11 @@ SYNOPSIS /var/log/postgresql.log cat /var/log/postgres.log | pgbadger - # Log prefix with stderr log output - perl pgbadger --prefix '%t [%p]: [%l-1] user=%u,db=%d,client=%h' + perl pgbadger --prefix '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h' /pglog/postgresql-2012-08-21* perl pgbadger --prefix '%m %u@%d %p %r %a : ' /pglog/postgresql.log # Log line prefix with syslog log output - perl pgbadger --prefix 'user=%u,db=%d,client=%h,appname=%a' + perl pgbadger --prefix 'user=%u,db=%d,client=%h,app=%a' /pglog/postgresql-2012-08-21* # Use my 8 CPUs to parse my 10GB file faster, much faster perl pgbadger -j 8 /pglog/postgresql-9.1-main.log @@ -253,6 +253,7 @@ FEATURE Histogram of query times. Histogram of sessions times. Users involved in top queries. + Applications involved in top queries. Queries generating the most cancellation. Queries most cancelled. @@ -367,29 +368,29 @@ POSTGRESQL CONFIGURATION Here every statement will be logged, on busy server you may want to increase this value to only log queries with a higher duration time. Note that if you have log_statement set to 'all' nothing will be logged - through log_min_duration_statement. See next chapter for more + through directive log_min_duration_statement. See next chapter for more information. With 'stderr' log format, log_line_prefix must be at least: log_line_prefix = '%t [%p]: [%l-1] ' - Log line prefix could add user, database name and client ip address as - follows: + Log line prefix could add user, database name, application name and + client ip address as follows: - log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,client=%h ' + log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h ' or for syslog log file format: - log_line_prefix = 'user=%u,db=%d,client=%h ' + log_line_prefix = 'user=%u,db=%d,app=%aclient=%h ' Log line prefix for stderr output could also be: - log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u,client=%h ' + log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u,app=%a,client=%h ' or for syslog output: - log_line_prefix = 'db=%d,user=%u,client=%h ' + log_line_prefix = 'db=%d,user=%u,app=%a,client=%h ' You need to enable other parameters in postgresql.conf to get more information from your log files: diff --git a/doc/pgBadger.pod b/doc/pgBadger.pod index ce2dcf5..d2f9b81 100644 --- a/doc/pgBadger.pod +++ b/doc/pgBadger.pod @@ -158,11 +158,11 @@ Examples: /var/log/postgresql.log cat /var/log/postgres.log | pgbadger - # Log prefix with stderr log output - perl pgbadger --prefix '%t [%p]: [%l-1] user=%u,db=%d,client=%h' + perl pgbadger --prefix '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h' /pglog/postgresql-2012-08-21* perl pgbadger --prefix '%m %u@%d %p %r %a : ' /pglog/postgresql.log # Log line prefix with syslog log output - perl pgbadger --prefix 'user=%u,db=%d,client=%h,appname=%a' + perl pgbadger --prefix 'user=%u,db=%d,client=%h,app=%a' /pglog/postgresql-2012-08-21* # Use my 8 CPUs to parse my 10GB file faster, much faster perl pgbadger -j 8 /pglog/postgresql-9.1-main.log @@ -254,6 +254,7 @@ pgBadger reports everything about your SQL queries: Histogram of query times. Histogram of sessions times. Users involved in top queries. + Applications involved in top queries. Queries generating the most cancellation. Queries most cancelled. @@ -364,29 +365,30 @@ You must first enable SQL query logging to have something to parse: log_min_duration_statement = 0 Here every statement will be logged, on busy server you may want to increase -this value to only log queries with a higher duration time. Note that if you have -log_statement set to 'all' nothing will be logged through log_min_duration_statement. -See next chapter for more information. +this value to only log queries with a higher duration time. Note that if you +have log_statement set to 'all' nothing will be logged through directive +log_min_duration_statement. See next chapter for more information. With 'stderr' log format, log_line_prefix must be at least: log_line_prefix = '%t [%p]: [%l-1] ' -Log line prefix could add user, database name and client ip address as follows: +Log line prefix could add user, database name, application name and client ip +address as follows: - log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,client=%h ' + log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h ' or for syslog log file format: - log_line_prefix = 'user=%u,db=%d,client=%h ' + log_line_prefix = 'user=%u,db=%d,app=%aclient=%h ' Log line prefix for stderr output could also be: - log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u,client=%h ' + log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u,app=%a,client=%h ' or for syslog output: - log_line_prefix = 'db=%d,user=%u,client=%h ' + log_line_prefix = 'db=%d,user=%u,app=%a,client=%h ' You need to enable other parameters in postgresql.conf to get more information from your log files: