ossc-db / pgaudit

PostgreSQL Audit Extension
Other
2 stars 4 forks source link

(refactored branch) Even if an unnecessary token exists in the setting file, it does not cause an error. #33

Closed harada-toshi closed 7 years ago

harada-toshi commented 7 years ago

Overview

config file sample

[output]
        logger = 'serverlog'
        level   = 'LOG'
}

[option]
        role = 'auditor'
}

[rule]
        format = '%t,%d,%u,%p,%v,%statement_id,%sub_statement_id,%class,%command_tag,%object_type,%object_name,%command_text'
        class = 'READ,WRITE,DDL,ROLE,FUNCTION,MISC' # error
}

PostgreSQL launch log.

$ pg_ctl -w -D ~/pgdata/9.6-pgaudit/ start
waiting for server to start....LOG:  log_catalog = 1
LOG:  log_level_string = (null)
LOG:  log_level = 15
LOG:  log_parameter = 0
LOG:  log_statement_once = 0
LOG:  log_for_test = 0
LOG:  role = auditor
LOG:  logger = serverlog
LOG:  facility = (null)
LOG:  priority = (null)
LOG:  ident = (null)
LOG:  option = (null)
LOG:  pathlog = (null)
LOG:  Rule 0
LOG:      BMP class = 500
LOG:  pgaudit extension initialized
}}}LOG:  database system was shut down at 2017-03-01 11:28:49 JST
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started
LOG:  connection received: host=[local]
LOG:  connection authorized: user=nuko database=postgres
FATAL:  role "nuko" does not exist
 done
server started
MasahikoSawada commented 7 years ago

Thank you for reporting.

Commit dfe3a9be1f4a3a30d24a5e2900c6dfe327abcdb2 should fix it, please confirm it.

harada-toshi commented 7 years ago

Thank you for fixing quickly! I confirmed that it was fixed.

$ pg_ctl -w -D ~/pgdata/9.6-pgaudit/ start
waiting for server to start....FATAL:  error invalid token "}" in "output section"
LOG:  database system is shut down
 stopped waiting
pg_ctl: could not start server
Examine the log output.
MasahikoSawada commented 7 years ago

Thanks, close it.