Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server_xml): adding log maxDays fileDateFormat #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ tomcat_access_log_directory: logs
tomcat_access_log_prefix: localhost_access_log
tomcat_access_log_suffix: ".txt"
tomcat_access_log_pattern: "%h %l %u %t "%r" %s %b"
tomcat_access_log_max_days: "1"
tomcat_access_log_file_date_format: ".yyyy-MM-dd.HH"

# This role allows multiple installations of Apache Tomcat, each in their own
# location, potentially of different version.
Expand Down Expand Up @@ -61,6 +63,8 @@ tomcat_instances:
access_log_prefix: "{{ tomcat_access_log_prefix }}"
access_log_suffix: "{{ tomcat_access_log_suffix }}"
access_log_pattern: "{{ tomcat_access_log_pattern }}"
access_log_max_days: "{{ tomcat_access_log_max_days }}"
access_log_file_date_format: "{{ tomcat_access_log_date_format }}"
service_state: "{{ tomcat_service_state }}"
service_enabled: "{{ tomcat_service_enabled }}"

Expand Down
2 changes: 2 additions & 0 deletions templates/server.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
{% if instance.access_log_enabled | default(tomcat_access_log_enabled) %}
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="{{ instance.access_log_directory | default(tomcat_access_log_directory) }}"
prefix="{{ instance.access_log_prefix | default(tomcat_access_log_prefix) }}" suffix="{{ instance.access_log_suffix | default(tomcat_access_log_suffix) }}"
fileDateFormat="{{ instance.access_log_file_date_format | default(tomcat_access_log_file_date_format) }}"
maxDays="{{ instance.access_log_max_days | default(tomcat_access_log_max_days) }}"
pattern="{{ instance.access_log_pattern | default(tomcat_access_log_pattern) }}" />
{% endif %}

Expand Down