Skip to content

Commit

Permalink
Configure renderd and postgres to log via syslog-ng
Browse files Browse the repository at this point in the history
  • Loading branch information
Homme Zwaagstra committed Mar 27, 2014
1 parent f4eda8d commit 7b689d2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ RUN sed --file /tmp/postgresql.conf.sed --in-place /etc/postgresql/9.1/main/post
RUN mkdir -p /etc/my_init.d
ADD shmmax.sh /etc/my_init.d/shmmax.sh

# Define the application logging logic
ADD syslog-ng.conf /etc/syslog-ng/conf.d/local.conf
RUN rm -rf /var/log/postgresql

# Create a `postgresql` `runit` service
ADD postgresql /etc/sv/postgresql
RUN update-service --add /etc/sv/postgresql
Expand Down
3 changes: 3 additions & 0 deletions postgresql.conf.sed
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ s/shared_buffers = 24MB/shared_buffers = 128MB/
s/#checkpoint_segments = 3/checkpoint_segments = 20/
s/#maintenance_work_mem = 16MB/maintenance_work_mem = 256MB/
s/#autovacuum = on/autovacuum = off/
s/#log_destination = 'stderr'/log_destination = 'stderr,syslog'/
s/#syslog_facility/syslog_facility/
s/#syslog_ident/syslog_ident/
15 changes: 15 additions & 0 deletions syslog-ng.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##
# Syslog-ng configuration for logging application services
#
# This file should be placed in `/etc/syslog-ng/conf.d`.
#

# Log Postgresql
destination postgres { file("/var/log/postgres.log"); };
filter f_postgres { facility(local0); };
log { source(s_src); filter(f_postgres); destination(postgres); };

# Log Renderd
destination renderd { file("/var/log/renderd.log"); };
filter f_renderd { program("renderd"); };
log { source(s_src); filter(f_renderd); destination(renderd); };

0 comments on commit 7b689d2

Please sign in to comment.