access logging to separate file with bamboo
Asked by Ryan Goodwin:

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}/logslog4j.appender.bamboolog=com.atlassian.bamboo.log.BambooRollingFileAppenderlog4j.appender.bamboolog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo.loglog4j.appender.bamboolog.MaxFileSize=61440KBlog4j.appender.bamboolog.MaxBackupIndex=20log4j.appender.bamboolog.layout=org.apache.log4j.PatternLayoutlog4j.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, accessloglog4j.additivity.com.atlassian.bamboo.util.AccessLogFilter=falselog4j.appender.accesslog=org.apache.log4j.RollingFileAppenderlog4j.appender.accesslog.Threshold=DEBUGlog4j.appender.accesslog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo-access.loglog4j.appender.accesslog.MaxFileSize=61440KBlog4j.appender.accesslog.MaxBackupIndex=20log4j.appender.accesslog.layout=org.apache.log4j.PatternLayoutlog4j.appender.accesslog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n
```

The WEB-INF/web.xml:

```
&lt;filter&gt;    &lt;filter-name&gt;accessLogFilter&lt;/filter-name&gt;    &lt;filter-class&gt;com.atlassian.bamboo.filter.AccessLogFilter&lt;/filter-class&gt;  &lt;/filter&gt;?  &lt;filter-mapping&gt;    &lt;filter-name&gt;accessLogFilter&lt;/filter-name&gt;    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;    &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;    &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;  &lt;/filter-mapping&gt;
```

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?


Answers:
author: Ryan Goodwin
body: 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, bamboologlog4j.appender.bamboolog=com.atlassian.bamboo.log.BambooRollingFileAppenderlog4j.appender.bamboolog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo.loglog4j.appender.bamboolog.MaxFileSize=61440KBlog4j.appender.bamboolog.MaxBackupIndex=20log4j.appender.bamboolog.layout=org.apache.log4j.PatternLayoutlog4j.appender.bamboolog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%n######################################################################################################################### Access Log########################################################################################################################log4j.appender.accesslog=org.apache.log4j.RollingFileAppenderlog4j.appender.accesslog.Threshold=DEBUGlog4j.appender.accesslog.File=/opt/atlassian/logs/bamboo/atlassian-bamboo-access.loglog4j.appender.accesslog.MaxFileSize=61440KBlog4j.appender.accesslog.MaxBackupIndex=20log4j.appender.accesslog.layout=org.apache.log4j.PatternLayoutlog4j.appender.accesslog.layout.ConversionPattern=%d %p [%t] [%c{1}] %m%nlog4j.category.com.atlassian.bamboo.filter.AccessLogFilter=INFO, accessloglog4j.additivity.com.atlassian.bamboo.filter.AccessLogFilter=false
```


author: Ryan Goodwin
body: I have also tried with log4j.appender.bamboolog=org.apache.log4j.RollingFileAppender


Tags: bamboo-administration