Hi,
I'd like to know how can I create my own logger filter (regarding to AccessLogFilter).
So I created ajava class AdminActivitiesLogFilter who implements filter (with all methods that I need).
Then, I updated the web.xml with this :
<filter>
<filter-name>AdminActivitiesLogFilter</filter-name>
<filter-class>...AdminActivitiesLogFilter</filter-class>
</filter>
Also the log4j.properties:
log4j.category.....AdminActivitiesLogFilter=INFO, accesslog
log4j.additivity.....AdminActivitiesLogFilter=false
I added the jar into the WEB-INF/lib
But I saw nothing in my log file.
Could you help me please ?
Community moderators have prevented the ability to post new answers.
You need to name the appender accesslog or use log4j.category.....AdminActivitiesLogFilter=INFO, jaspersAccessLog
to write to your log. At the moment you have the problem that confluence did not know where to log. Regards Steve
Maybe I've to add this in my code :
PropertyConfigurator.configure("log4j.properties");
to load properties of log4j.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't have any appender for accesslog because I'm using a custom:
log4j.appender.jaspersAccessLog=org.apache.log4j.RollingFileAppender
log4j.appender.jaspersAccessLog.Threshold=DEBUG
log4j.appender.jaspersAccessLog.File=${catalina.home}/logs/atlassian-confluence-jaspers-access.log
log4j.appender.jaspersAccessLog.MaxFileSize=20480KB
log4j.appender.jaspersAccessLog.MaxBackupIndex=5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Steve,
Thank you for your answer. I've already a filter mapping in the web.xml in installation directory of Confluence.
But the following lines don't seem to work correctly:
log4j.category.....AdminActivitiesLogFilter=INFO, accesslog
log4j.additivity.....AdminActivitiesLogFilter=false
It writes nothing in mon log file.
I'll test the other method in your link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have you defined an appender for accesslog like log4j.appender.accesslog.*?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try a filter module in a plugin:
https://developer.atlassian.com/display/DOCS/Servlet+Filter+Plugin+Module
This should work.
If you want to do it your way, you will need at least a filter-mapping in your web.xml ;)
Regards
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.