This is a web application which uses Postgres to store data pushed from various modules of the web application.
From Postgres side, how can I know what data entered/modified into Postgres? I mean if there is any Postgres data logging?
Postgres has 4-5 schemas & each schema has 2-3 tables. Each table has 10-20 records.
EDIT (8 Sept 2021):
log_destination=csvlog- I tried different destinations to see if I'm getting the required logs. But all log destination are capturing the same logs.
2: reload - Did restarted server every time I made
changes to postgresql.conf.
3: The logs are being generated at
/var/lib/postgresql/data/pg_log directory with format
postgresql-%Y-%m-%d_%H%M%S.log. Where latest logs are generated, but as mentioned in comment, I'm not getting all the query logs that are being executed on Postgres by the web application
4: I installed Postgres 9.6 as a Docker container.
5: I'm making changes in
/var/lib/postgresql/data/postgresql.conf which is reflected in
database query SELECT name, setting FROM pg_settings WHERE name LIKE '%log%'; after restart.
EDIT (7 Sept 2021):
name |setting |
---------------------------+------------------------------+
log_autovacuum_min_duration|-1 |
log_checkpoints |off |
log_connections |off |
log_destination |csvlog |
log_directory |pg_log |
log_disconnections |off |
log_duration |off |
log_error_verbosity |default |
log_executor_stats |off |
log_file_mode |0600 |
log_filename |postgresql-%Y-%m-%d_%H%M%S.log|
log_hostname |off |
log_line_prefix | |
log_lock_waits |off |
log_min_duration_statement |-1 |
log_min_error_statement |error |
log_min_messages |warning |
log_parser_stats |off |
log_planner_stats |off |
log_replication_commands |off |
log_rotation_age |1440 |
log_rotation_size |10240 |
log_statement |all |
log_statement_stats |off |
log_temp_files |-1 |
log_timezone |Etc/UTC |
log_truncate_on_rotation |off |
logging_collector |on |
syslog_facility |local0 |
syslog_ident |postgres |
syslog_sequence_numbers |on |
syslog_split_messages |on |
wal_log_hints |off |
EDIT
PostgreSQL 9.6.22 on x86_64-pc-linux-gnu (Debian 9.6.22-1.pgdg90+1), compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit|tagin the OP.