send service logs to local6 facility to save space

Otherwise all service logs go into `/var/log/syslog` which becomes huge.

The `local6` syslog facility is the one handled by our default rsyslog
configuration and sends logs to `/var/log/service` directories as well
as to Logstash service for aggregation in the ELK stack.

Depends on:
https://github.com/status-im/infra-role-bootstrap-linux/commit/9ad8bb7d

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2021-09-02 11:24:26 +02:00
parent 43fb41a81c
commit 5c3e0d9a62
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ beacon_node_path: '/data/{{ beacon_node_service_name }}'
beacon_node_data_path: '{{ beacon_node_path }}/data' beacon_node_data_path: '{{ beacon_node_path }}/data'
beacon_node_data_folder: 'shared_{{ beacon_node_network }}_0' beacon_node_data_folder: 'shared_{{ beacon_node_network }}_0'
beacon_node_repo_path: '{{ beacon_node_path }}/repo' beacon_node_repo_path: '{{ beacon_node_path }}/repo'
beacon_node_logs_link: '{{ beacon_node_path }}/logs'
beacon_node_netkey_path: '{{ beacon_node_data_path }}/netkey' beacon_node_netkey_path: '{{ beacon_node_data_path }}/netkey'
beacon_node_rpc_script_path: '{{ beacon_node_path }}/rpc.sh' beacon_node_rpc_script_path: '{{ beacon_node_path }}/rpc.sh'
beacon_node_build_script_path: '{{ beacon_node_path }}/build.sh' beacon_node_build_script_path: '{{ beacon_node_path }}/build.sh'

View File

@ -1,4 +1,11 @@
--- ---
- name: Symlink service logs folder
file:
src: '/var/log/service/{{ beacon_node_service_name }}'
dest: '{{ beacon_node_logs_link }}'
state: 'link'
force: true
- name: Create systemd Unit file - name: Create systemd Unit file
template: template:
src: 'beacon-node.service.j2' src: 'beacon-node.service.j2'

View File

@ -8,6 +8,8 @@ After=network-online.target
User={{ beacon_node_user }} User={{ beacon_node_user }}
Group={{ beacon_node_group }} Group={{ beacon_node_group }}
WorkingDirectory={{ beacon_node_path }} WorkingDirectory={{ beacon_node_path }}
SyslogIdentifier={{ beacon_node_service_name }}
SyslogFacility=local6
Restart=on-failure Restart=on-failure
ExecStart={{ beacon_node_repo_path }}/build/nimbus_beacon_node \ ExecStart={{ beacon_node_repo_path }}/build/nimbus_beacon_node \
--network={{ beacon_node_network }} \ --network={{ beacon_node_network }} \