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
This commit is contained in:
Roberto Cirillo 2017-10-25 17:49:42 +02:00
parent aa4bc93e36
commit 37698dff6d
2 changed files with 24 additions and 2 deletions

View File

@ -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

View File

@ -90,6 +90,28 @@
</logger>
{% endif %}
{% if smartgears_appender_list is defined %}
{% for obj in smartgears_appender_list %}
<appender name="{{ obj.appender_name }}" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/home/gcube/tomcat/logs/{{ obj.appender_file_name }}.log</file>
<append>true</append>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{0}: %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/home/gcube/tomcat/logs/{{ obj.appender_file_name | default('custom') }}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>{{ obj.appender_maxHistory | default('30') }}</maxHistory>
<maxFileSize>{{ obj.appender_maxFileSize | default('10MB') }}</maxFileSize>
<totalSizeCap>{{ obj.appender_totalSizeCap | default('2GB') }}</totalSizeCap>
</rollingPolicy>
</appender>
<logger name="{{ obj.appender_package }}" level="{{ obj.appender_level | default('WARN') }}">
<appender-ref ref="{{ obj.appender_name | default('SERVICE') }}" />
</logger>
{% endfor %}
{% endif %}
<logger name="org.gcube.data.publishing" level="FATAL">
<appender-ref ref="ACCOUNT_FILE" />
</logger>