1

我正在尝试在 Windows 10 和 Postgresql 11 上使用 pgBadger

安装的 Perl

安装明威

以及在 perl 和 mingw 的 Windows 上定义的所有路径设置

编译pgBadger(成功)

看起来在我的窗户上一切正常

*** 日志文件中的一些行

2019-07-11 14:41:05 +03 [6604]:[47] user=postgres, db=demo_test LOG:  duration: 0.349 ms  statement: SELECT * FROM corporations ORDER BY id 

2019-07-11 14:41:07 +03 [6604]:[48] user=postgres, db=demo_test LOG:  duration: 0.046 ms  statement: 

2019-07-11 14:41:07 +03 [6604]:[49] user=postgres, db=demo_test LOG:  duration: 0.012 ms  statement: 

2019-07-11 14:41:07 +03 [6604]:[50] user=postgres, db=demo_test LOG:  duration: 6.884 ms  statement: Select * From pg_available_extensions order  by NAME

2019-07-11 14:41:07 +03 [6604]:[51] user=postgres, db=demo_test LOG:  duration: 0.029 ms  statement: 

2019-07-11 14:41:07 +03 [6604]:[52] user=postgres, db=demo_test LOG:  duration: 0.077 ms  statement: SELECT 11651::regclass

2019-07-11 14:41:12 +03 [6604]:[53] user=postgres, db=demo_test LOG:  duration: 0.052 ms  statement: 

2019-07-11 14:41:12 +03 [6604]:[54] user=postgres, db=demo_test LOG:  duration: 0.040 ms  statement: 

2019-07-11 14:41:12 +03 [6604]:[55] user=postgres, db=demo_test LOG:  duration: 1.604 ms  statement: SELECT * FROM currency_stocks ORDER BY id DESC 

2019-07-11 14:41:16 +03 [6604]:[56] user=postgres, db=demo_test LOG:  duration: 0.020 ms  statement: 

2019-07-11 14:41:16 +03 [6604]:[57] user=postgres, db=demo_test LOG:  duration: 0.012 ms  statement: 

2019-07-11 14:41:16 +03 [6604]:[58] user=postgres, db=demo_test LOG:  duration: 314.062 ms  statement: SELECT * FROM (  SELECT uuid_generate_v4() FROM generate_series(1, 1000) ) AS x

2019-07-11 14:41:23 +03 [12348]:[15] user=postgres, db=demo_test LOG:  duration: 0.018 ms  statement: 

2019-07-11 14:41:23 +03 [11088]:[15] user=postgres, db=db_test2 LOG:  duration: 0.017 ms  statement: 

*** 并在当前文件夹(CMD)上运行以下命令:C:\PostgreSQL\pgBadger> 并且 postgresql 的日志目的地是:C:\PostgreSQL\11\data\log

perl pgbadger -v -f stderr -p "%t [%p]:[%l] user=%u, db=%d " ../11/data/log/postgresql-2019-07-11_143954.log

*** 当我运行脚本时,结果在命令行:

C:\PostgreSQL\pgBadger>perl pgbadger -v -f stderr -p "%t [%p]:[%l] user=%u, db=%d " ../11/data/log/postgresql-2019 -07-11_143954.log

DEBUG: timezone not specified, using -10800 seconds

DEBUG: Output 'html' reports will be written to out.html

DEBUG: Autodetected log format 'stderr' from ../11/data/log/postgresql-2019-07-11_143954.log

DEBUG: pgBadger will use log format stderr to parse ../11/data/log/postgresql-2019-07-11_143954.log.

DEBUG: the log statistics gathering took: 0 wallclock secs ( 0.03 usr +  0.00 sys =  0.03 CPU)

DEBUG: Output 'html' reports will be written to out.html

DEBUG: Processing log file: ../11/data/log/postgresql-2019-07-11_143954.log

LOG: Ok, generating html report...

DEBUG: Starting reading file ../11/data/log/postgresql-2019-07-11_143954.log...ents: 0

DEBUG: Start parsing postgresql log at offset 0 of file ../11/data/log/postgresql-2019-07-11_143954.log to 23131

[=======================> ] Parsed 22911 bytes of 23131 (99.05%), queries: 191, events: 3

DEBUG: building reports took:  0 wallclock secs ( 0.01 usr +  0.01 sys =  0.03 CPU)

DEBUG: the total execution time took:  0 wallclock secs ( 0.05 usr +  0.01 sys =  0.06 CPU)

一些设置在 postgresql.conf 相关的 pgBadger 中:

log_checkpoints = on 

log_connections = on 

log_disconnections = on 

log_error_verbosity = default   

log_lock_waits = on 

log_line_prefix = '%t [%p]:[%l] user=%u, db=%d ' 

log_statement = none 

log_temp_files = 0  

log_autovacuum_min_duration = 0 

# log_statement = none ## same result enable this setting 

lc_messages =  'C' 

最后结果是 out.html 当我打开时

没有数据集

有什么建议或技巧吗?

任何帮助将不胜感激

4

0 回答 0