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.
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.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.