Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

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>

Thanks for the reply Velle. 

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

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

256 views 2 9
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