Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgBadger - generated report is empty but postgres log has events

Tags:

postgresql

I've got problem with postgresql vs. pgBadger.

HTML reports wich were generated by pgBadger are empty (0 queries, 0 events, nothing about postgres work). But postgres log isnt' empty. There are events, etc.

I've tried many combinations with parameteres in postgresql.conf, (eg. log_destination = syslog, with logging_collector = off, log_line_prefix - more or less values), and still the same.

At present, that parameteres was set in postgresql.conf:

log_destination = 'stderr'

logging_collector = on

log_directory = 'pg_log' 
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'

client_min_messages = notice
log_min_messages = notice 
log_min_error_statement = error

log_min_duration_statement = 0

log_checkpoints = on
log_connections = on
log_duration = off
log_line_prefix = '%t [%r] [%p]: [%l-1] user=%u,db=%d,e=%e '
log_statement = 'all'

lc_messages = 'en_US.UTF-8' 

That's how I'm trying to use pgBadger and what I get in result:

#pgbadger -p -l /var/lib/postgresql/9.3/main/pg_log/postgresql-2014-10-15_125036.log -f stderr -o /var/lib/postgresql/9.3/main/pg_log/report.html

or

#pgbadger -p -l /var/log/postgresql/postgresql-9.3-main.log -f stderr -o /var/log/postgresql/log_report.html

and the result is always the same:

/usr/src/pgbadger-6.2# pgbadger -p -l /var/lib/postgresql/9.3/main/pg_log/postgresql-2014-10-15_125036.log -f stderr -o /var/lib/postgresql/9.3/main/pg_log/report.html
[========================>] Parsed 12999 bytes of 12999 (100.00%), queries: 0, events: 0
LOG: Ok, generating html report...

I work with: Debian 7, postgresql 9.3, pgbadger-6.2

Has anyone got similar problem with it?

like image 766
margotix Avatar asked Oct 15 '14 12:10

margotix


2 Answers

Make sure the log_line_prefix in postgresql.conf is as:

log_line_prefix = '%t [%p]: [%l-1] db=%d,user=%u ' 
like image 175
Sandeep Avatar answered Sep 26 '22 17:09

Sandeep


Actually i have got same problem. Can you follow this doc and fix your problem. Thanks

http://www.antelink.com/blog/using-pgbadger-monitor-your-postgresql-activity.html

I think you need to change log_statement to 'none'. then it may be resolve your problem.

You should use -v option to verbose mode.

pgbadger -f stderr -v /Data-directory/postgresql-Sat.log -o /Data-directory/postgresql-reports.html

Please change data directory as per your PostgreSQL cluster data

like image 25
Ramu Mathi Avatar answered Sep 24 '22 17:09

Ramu Mathi