How do I set up the log generated in the Bamboo install directory to rotate?

David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Bamboo writes a single log to <BAMBOOINSTALL>/logs/bamboo.log and this can become extremely large for a long-running, busy instance.

I'd like to be able to rotate the log, so that at the end of every day, the log content for that day is spun off into its own date-stamped log.

So instead of:

<BAMBOOINSTALL>/logs/bamboo.log

I could have logs in the format "bamboo.YYYY-MM-DD.log" like:

<BAMBOOINSTALL>/logs/bamboo.2012-03-15.log
<BAMBOOINSTALL>/logs/bamboo.2012-03-16.log
<BAMBOOINSTALL>/logs/bamboo.2012-03-17.log

5 answers

1 vote
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Modify the log4j.properties file under Bamboo/webapp/WEB-INF/classes folder to use DailyRollingFileAppender.

David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Hey Jobin,
That appears to be for the <BAMBOOHOME>/logs/atlassian-bamboo.log.x logs.

I'm specifically looking for <BAMBOOINSTALL>/log/bamboo.log. I've got a feeling it's something I need to tweak in wrapper.conf. I'll check the Tanuki Wrapper docs. I need to modify the following section:

#********************************************************************
# Wrapper Logging Properties
#********************************************************************

wrapper.console.format=PM
wrapper.console.loglevel=INFO
wrapper.logfile=../logs/bamboo.log
wrapper.logfile.format=LPTM
wrapper.logfile.loglevel=INFO
wrapper.logfile.maxsize=10m
wrapper.logfile.maxfiles=10
wrapper.syslog.loglevel=NONE

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 14, 2012

IIRC, one of the patched jar files you got will change the log level to DEBUG.

0 votes
David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

I hope so! We restarted yesterday, and we've already got a 1.8GB bamboo.log!
Is there anything that can be done to reduce this ahead of upgrading to the next release?

0 votes
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 14, 2012

BTW, I think I know which messages you're talking about in your specific case. There will be considerably less stuff logged on your instance with the next release.

0 votes
David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Seems to be controlled by this property that needs to be set in wrapper.conf:

http://wrapper.tanukisoftware.com/doc/english/prop-logfile-rollmode.html

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Cool. Let us know if it worked.

David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

It didn't work.
<BAMBOOINSTALL>/log/bamboo.sh over-rides the log settings in wrapper.conf in the following line:

        $RUNNER "nohup sh -c \"cd $BAMBOO_INSTALL && exec $RUN_CMD 2>&1\" >$BAMBOO_LOG_FILE & umask 022 ; echo \$! > $BAMBOO_PID"

, where BAMBOO_LOG_FILE is defined earlier in the shell script as:

BAMBOO_LOG_FILE=${BAMBOO_LOG_FILE:-$BAMBOO_INSTALL/logs/bamboo.log}

I guess I can hack bamboo.sh to include some form of timestamp, but it this will only ensure that a rollover occurs when Bamboo is restarted, and not every day as desired. Bummer

David Corley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 14, 2012

Improvement request created here:
https://jira.atlassian.com/browse/BAM-11246

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events