8000 Update PG logging config · suryatmodulus/postgres@d8e72b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit d8e72b5

Browse files
committed
Update PG logging config
1 parent 7ecf5de commit d8e72b5

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

ansible/files/logrotate-postgres

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/var/lib/postgresql/data/pg_log/postgresql.log {
1+
/var/log/postgresql/postgresql.log {
22
size 50M
33
rotate 3
44
copytruncate

ansible/files/logrotate-postgres-csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/var/lib/postgresql/data/pg_log/postgresql.csv {
1+
/var/log/postgresql/postgresql.csv {
22
size 50M
33
rotate 9
44
compress

ansible/files/postgresql_config/postgresql.conf.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,11 @@ logging_collector = on # Enable capturing of stderr and csvlog
440440
# (change requires restart)
441441

442442
# These are only used if logging_collector is on:
443-
log_directory = 'pg_log' # directory where log files are written,
443+
log_directory = '/var/log/postgresql' # directory where log files are written,
444444
# can be absolute or relative to PGDATA
445445
log_filename = 'postgresql.log' # log file name pattern,
446446
# can include strftime() escapes
447-
# log_file_mode = 0600 # creation mode for log files,
447+
log_file_mode = 0640 8000 # creation mode for log files,
448448
# begin with 0 to use octal notation
449449
log_rotation_age = 0 # Automatic rotation of logfiles will
450450
# happen after that time. 0 disables.
@@ -791,4 +791,4 @@ jit_provider = 'llvmjit' # JIT library to use
791791
# CUSTOMIZED OPTIONS
792792
#------------------------------------------------------------------------------
793793

794-
# Add settings for extensions here
794+
# Add settings for extensions here

ansible/tasks/setup-postgres.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@
103103
owner: postgres
104104
group: postgres
105105

106+
- name: Create logs dir
107+
become: yes
108+
file:
109+
path: /var/log/postgresql
110+
state: directory
111+
owner: postgres
112+
group: postgres
113+
106114
# Move Postgres configuration files into /etc/postgresql
107115
# Add postgresql.conf
108116
- name: import postgresql.conf
@@ -131,7 +139,7 @@
131139
register: postgresql_bin
132140

133141
- name: Create symbolic links for Postgres binaries to /usr/bin/
134-
become: True
142+
become: yes
135143
file:
136144
src: "{{ item.path }}"
137145
path: "/usr/bin/{{ item.path | basename }}"

ansible/tasks/setup-supabase-internal.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
deb: "{{ vector_arm_deb }}"
4040
when: platform == "arm64"
4141

42+
- name: add Vector to postgres group
43+
become: yes
44+
shell:
45+
cmd: |
46+
usermod -a -G postgres vector
47+
4248
- name: Install Postgres exporter
4349
import_tasks: internal/postgres-exporter.yml
4450

0 commit comments

Comments
 (0)
0