Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

change location of Bitbucket log direcotry

Defaultly the logs are stored under the Bitbucket Home directory. As the orgnistaions design we are forced to keep logs files in specific drive. 

For this I need to changes the ${log.dir} location.

I see following line in logback.xml but do not know how do I give value to log dir,

 

<define name="log.dir" class="com.atlassian.stash.internal.logback.LogDirectoryPropertyDefiner"
scope="context"/>

 

Help me to change the default log location

Platform is windows.

2 answers

https://confluence.atlassian.com/bitbucketserverkb/configure-bitbucket-server-logging-779171678.html

In atlassian-bitbucket-5.2.2/app/WEB-INF/classes/logback.xml change:

<file>${log.dir}/atlassian-bitbucket.log</file>

Thanks for the reply Velle. 

I was already went through the article but did not wanted to specify locations at multiple files tags :)

Late to the party, but I've found a solution that should be documented. I was running into the same issue of not wanting to repeat the same location in multiple appender definitions. I was able to solve it by defining a variable in the logback.xml file.

Since Bitbucket Server uses Logback as its logging utility, I followed the Variable Substitution section of the Logback Configuration Documentation.

<property name="mylog.dir" value="/var/log/bitbucket"/>

Instead of the <define> tag that Atlassian uses to import their pre-defined variables (like log.dir), Logback can also use the <property> tag to define a local variable that can then be access using ${mylog.dir}.

This can then be used in an appender definition such as the following:

<appender name="bitbucket.application" class="ch.qos.logback.core.FileAppender">
    <file>${mylog.dir}/atlassian-bitbucket.log</file>
</appender>

Alleviating the need to repeat the same location many times!

I've done this successfully on Bitbucket Server 7.2 within the local logback.xml file within my <bitbucket-home> directory. I'm not sure if this solution was a possibility back in Bitbucket Server 5.2 from the other answer.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,849 views 0 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you