Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Access logs in Jira in Docker

Михаил Малиновкин October 15, 2018

Hi All,

How do you rotate/collect tomcat access logs in jira docker container ? Each log size 500 Mb. If i dont remove access logs my /var/lib/docker  overflowing.

Here i found a solution, but share your expirience for this problem )
https://github.com/nginxinc/docker-nginx/blob/48a4c531fc4bfa80d4270f20a67e2e958856860c/stable/stretch/Dockerfile#L91-L93

 

2 answers

0 votes
Михаил Малиновкин October 22, 2018

Hi there,

I want my container will be stateless, without any utilities from host station.

When i build container i use sed utility, add maxdays tomcat parameter and edit server.xml

RUN sed -i -r 's#className=\"org.apache.catalina.valves.AccessLogValve\"#className=\"org.apache.catalina.valves.AccessLogValve\" maxDays=\"7\"#' ${JIRA_INSTALL_DIR}/conf/server.xml \ && sed -i -e 's/= catalina./= catalina.\n1catalina.org.apache.juli.AsyncFileHandler.maxDays = 14/' ${JIRA_INSTALL_DIR}/conf/logging.properties \ && sed -i -e 's/= localhost./= localhost.\n2localhost.org.apache.juli.AsyncFileHandler.maxDays = 14/' ${JIRA_INSTALL_DIR}/conf/logging.properties \ && sed -i -e 's/= manager./= manager.\n3manager.org.apache.juli.AsyncFileHandler.maxDays = 14/' ${JIRA_INSTALL_DIR}/conf/logging.properties \ && sed -i -e 's/= host-manager./= host-manager.\n4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 14/' ${JIRA_INSTALL_DIR}/conf/logging.properties

After that i can pull and start my container on any station.

0 votes
Moga
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 17, 2018

Hi there,

You can use logrotate to do what you are looking for. You can use this article as a reference.

Best Regards,
Mogavenasan

Suggest an answer

Log in or Sign up to answer