Skip to content

Commit

Permalink
Improvements for the local logs configuration (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
akolotov authored Sep 18, 2021
1 parent 4412046 commit fdb18a1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
4 changes: 2 additions & 2 deletions deployment/roles/common/templates/docker-logs.j2
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/var/log/docker/*/docker.log {
rotate 5
size 1G
size 100M
compress
missingok
delaycompress
copytruncate
}
/var/log/docker/*.log {
rotate 5
size 1G
size 100M
compress
missingok
delaycompress
Expand Down
18 changes: 17 additions & 1 deletion deployment/roles/oracle/tasks/logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,30 @@
loop_control:
loop_var: file

- name: Set the local container logs configuration file
- name: Set the oracle's containers local logs configuration file
template:
src: 31-oracle-docker.conf.j2
dest: /etc/rsyslog.d/31-oracle-docker.conf
owner: root
group: root
mode: 0644

- name: Set the redis container local logs configuration file
template:
src: 32-redis-docker.conf.j2
dest: /etc/rsyslog.d/32-redis-docker.conf
owner: root
group: root
mode: 0644

- name: Set the rabbit MQ container local logs configuration file
template:
src: 33-rabbit-docker.conf.j2
dest: /etc/rsyslog.d/33-rabbit-docker.conf
owner: root
group: root
mode: 0644

- name: Set the log configuration file to send container logs to remote server
template:
src: 36-oracle-remote-logging.conf.j2
Expand Down
11 changes: 11 additions & 0 deletions deployment/roles/oracle/templates/32-redis-docker.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$FileCreateMode 0644
template(name="DockerLogFileName_Redis" type="list") {
constant(value="/var/log/docker/")
property(name="syslogtag" securepath="replace" regex.type="ERE" regex.submatch="1" regex.expression="oracle_(.*redis.*)\\/[a-zA-Z0-9]+\\[")
constant(value="/docker.log")
}

if $programname contains 'oracle' and $programname contains 'redis' then \
?DockerLogFileName_Redis

$FileCreateMode 0600
11 changes: 11 additions & 0 deletions deployment/roles/oracle/templates/33-rabbit-docker.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$FileCreateMode 0644
template(name="DockerLogFileName_Rabbit" type="list") {
constant(value="/var/log/docker/")
property(name="syslogtag" securepath="replace" regex.type="ERE" regex.submatch="1" regex.expression="oracle_(.*rabbit.*)\\/[a-zA-Z0-9]+\\[")
constant(value="/docker.log")
}

if $programname contains 'oracle' and $programname contains 'rabbit' then \
?DockerLogFileName_Rabbit

$FileCreateMode 0600

0 comments on commit fdb18a1

Please sign in to comment.