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

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

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

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

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

Cool. Let us know if it worked.

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

0 vote

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.

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 vote

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,489 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you