From 62687973fc8fe98f4bf228b71f907b0a746d53f0 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Mon, 23 Jan 2023 17:07:58 +0100 Subject: [PATCH] logging config --- tasks/main.yml | 9 ++++++++- templates/elasticsearch-logrotate.j2 | 10 ++++++++++ templates/elasticsearch.yml.j2 | 5 ++++- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 templates/elasticsearch-logrotate.j2 diff --git a/tasks/main.yml b/tasks/main.yml index d6e4489..3abef2c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -67,6 +67,13 @@ shell: cmd: "{{ nextcloud_elasticsearch_bin_dir }}/elasticsearch-plugin install --batch ingest-attachment" +- name: Set elasticsearch logrotate config + template: + src: elasticsearch-logrotate.j2 + dest: /etc/logrotate.d/elasticsearch + owner: root + group: root + - name: Restart elasticsearch service: name: elasticsearch @@ -74,7 +81,7 @@ enabled: yes daemon_reload: yes -- name: Set live-index serice file +- name: Set live-index service file template: src: nextcloud-fulltextsearch-live-index.service.j2 dest: /etc/systemd/system/nextcloud-fulltextsearch-live-index.service diff --git a/templates/elasticsearch-logrotate.j2 b/templates/elasticsearch-logrotate.j2 new file mode 100644 index 0000000..d664500 --- /dev/null +++ b/templates/elasticsearch-logrotate.j2 @@ -0,0 +1,10 @@ +/var/log/elasticsearch/elasticsearch.log { +daily +missingok +rotate 30 +compress +delaycompress +notifempty +create 640 elasticsearch elasticsearch +su root elasticsearch +} \ No newline at end of file diff --git a/templates/elasticsearch.yml.j2 b/templates/elasticsearch.yml.j2 index 3def9fb..a60886c 100644 --- a/templates/elasticsearch.yml.j2 +++ b/templates/elasticsearch.yml.j2 @@ -85,4 +85,7 @@ http.port: {{ elasticsearch_nextcloud_port }} # # Require explicit names when deleting indices: # -#action.destructive_requires_name: true \ No newline at end of file +#action.destructive_requires_name: true + +# Log level +logger.org.elasticsearch.transport: ERROR \ No newline at end of file