From 37698dff6d907ec44a8ed0f3c7d256cd90ebc868 Mon Sep 17 00:00:00 2001 From: Roberto Date: Wed, 25 Oct 2017 17:49:42 +0200 Subject: [PATCH] group_vars/twittermon_dev/twittermon_dev.yml add smartgears_appender_list configuration group_vars/twittermon_plugins/twittermon_plugins.yml add smartgears_appender_list configuration ans set smartgears_nginx_expose_tomcat_logs to True ../library/roles/smartgears/smartgears/templates/logback.xml.j2 add custom appenders configuration ../library/roles/smartgears/smartgears/tasks/smartgears-app.yml fix tag smartgears_conf --- .../smartgears/tasks/smartgears-app.yml | 4 ++-- .../smartgears/templates/logback.xml.j2 | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml index 257a2b1..e8316e0 100644 --- a/smartgears/smartgears/tasks/smartgears-app.yml +++ b/smartgears/smartgears/tasks/smartgears-app.yml @@ -80,11 +80,11 @@ - name: Get the real smartgears version from the exploded distribution filename shell: /bin/ls -1 {{ smartgears_downloads_dir }} | grep smartgears-distribution | grep -v tar.gz | sed -e 's/smartgears-distribution-//g' register: smartgears_real_version - tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ] + tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] - name: Set the real smartgears distribution version set_fact: smartgears_real_distribution_version="{{ smartgears_real_version.stdout }}" - tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ] + tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] - name: Create the directory where we put the smartgears configuration snippets become: True diff --git a/smartgears/smartgears/templates/logback.xml.j2 b/smartgears/smartgears/templates/logback.xml.j2 index f6c0a54..48b171f 100644 --- a/smartgears/smartgears/templates/logback.xml.j2 +++ b/smartgears/smartgears/templates/logback.xml.j2 @@ -90,6 +90,28 @@ {% endif %} +{% if smartgears_appender_list is defined %} +{% for obj in smartgears_appender_list %} + + /home/gcube/tomcat/logs/{{ obj.appender_file_name }}.log + true + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n + + + /home/gcube/tomcat/logs/{{ obj.appender_file_name | default('custom') }}.%d{yyyy-MM-dd}.%i.log + {{ obj.appender_maxHistory | default('30') }} + {{ obj.appender_maxFileSize | default('10MB') }} + {{ obj.appender_totalSizeCap | default('2GB') }} + + + + + +{% endfor %} +{% endif %} + +