access logging to separate file with bamboo

Ryan Goodwin
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.
November 6, 2014

Bamboo version 5.0.1

I have access logging going to a separate file (atlassian-bamboo-access.log) with a second appender, but the access logging still shows up in the standard logs (atlassian-bamboo.log).

Here is my log4j.properties:

#
# Change the following line to configure the bamboo logging levels (one of INFO, DEBUG, ERROR, FATAL)
#
log4j.rootLogger=WARN, bamboolog

#using 'bamboo home aware' appender. If the File is relative a relative Path the file goes into {bamboo.home}/logs


log4j.appender.bamboolog=com.atlassian.bamboo.log.BambooRollingFileAppender
log4j.appender.bamboolog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo.log
log4j.appender.bamboolog.MaxFileSize=61440KB
log4j.appender.bamboolog.MaxBackupIndex=20
log4j.appender.bamboolog.layout=org.apache.log4j.PatternLayout
log4j.appender.bamboolog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n


# This log below gives more correct line can class details
#log4j.appender.console.layout.ConversionPattern=%d %p [%t] [%C{1}:%L] %m%n
#log4j.appender.bamboolog.layout.ConversionPattern=%d %p [%t] [%C{1}:%L] %m%n

########################################################################################################################
# Access Log
########################################################################################################################
log4j.category.com.atlassian.bamboo.filter.AccessLogFilter=INFO, accesslog
log4j.additivity.com.atlassian.bamboo.util.AccessLogFilter=false


log4j.appender.accesslog=org.apache.log4j.RollingFileAppender
log4j.appender.accesslog.Threshold=DEBUG
log4j.appender.accesslog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo-access.log
log4j.appender.accesslog.MaxFileSize=61440KB
log4j.appender.accesslog.MaxBackupIndex=20
log4j.appender.accesslog.layout=org.apache.log4j.PatternLayout
log4j.appender.accesslog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n

The WEB-INF/web.xml:

<filter>
    <filter-name>accessLogFilter</filter-name>
    <filter-class>com.atlassian.bamboo.filter.AccessLogFilter</filter-class>
  </filter>
 
  <filter-mapping>
    <filter-name>accessLogFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>

Again, everything logs correctly to the atlassian-bamboo-access.log file, but I'm also seeing the access logging in the standard logs - which I would like to stop - so that access logging only goes to the access logs. 

I suppose I should say I took this from the Confluence docs and modified the classes use "bamboo" instead of "confluence" so I'm guessing there may be a difference I'm not accounting for.

Ideas?

 

2 answers

1 accepted

1 vote
Answer accepted
Ryan Goodwin
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.
December 3, 2014

Figured this out, if anyone is interested in bamboo access logging to unique file. There's a very solid chance it was working in the above example, but the declared logging location wasn't where I expected it to be smile

 

########################################################################################################################
# Application Log
########################################################################################################################


log4j.rootLogger=INFO, bamboolog
log4j.appender.bamboolog=com.atlassian.bamboo.log.BambooRollingFileAppender
log4j.appender.bamboolog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo.log
log4j.appender.bamboolog.MaxFileSize=61440KB
log4j.appender.bamboolog.MaxBackupIndex=20
log4j.appender.bamboolog.layout=org.apache.log4j.PatternLayout
log4j.appender.bamboolog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n


########################################################################################################################
# Access Log
########################################################################################################################


log4j.appender.accesslog=org.apache.log4j.RollingFileAppender
log4j.appender.accesslog.Threshold=DEBUG
log4j.appender.accesslog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo-access.log
log4j.appender.accesslog.MaxFileSize=61440KB
log4j.appender.accesslog.MaxBackupIndex=20
log4j.appender.accesslog.layout=org.apache.log4j.PatternLayout
log4j.appender.accesslog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n

log4j.category.com.atlassian.bamboo.filter.AccessLogFilter=INFO, accesslog
log4j.additivity.com.atlassian.bamboo.filter.AccessLogFilter=false
0 votes
Ryan Goodwin
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.
November 6, 2014

I have also tried with log4j.appender.bamboolog=org.apache.log4j.RollingFileAppender

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events