Confluence 2.5.6 : Enable user access logging
This page last changed on Nov 28, 2006 by ivan@atlassian.com.
Generate a basic log indicating which users are accessing which pages in Confluence. Application servers are able to log the requested URL, but they cannot determine the currently logged in user. This log is not currently formatted to be accessible to web log analysis tools such as AwStats as it lacks a host and get method, so must be viewed manually. Similar to JIRA, Confluence has a built-in access logging mechanism, which shows the user and URL invoked. To enable it, you need to modify a couple of configuration files and restart Confluence. Configuring the AccessLogFilterThere is a simple AccessLogFilter in Confluence than can be enabled via log4j.properties and web.xml. You need to uncomment these lines in log4j.properties: log4j.category.com.atlassian.confluence.util.AccessLogFilter=INFO, confluencelog And enable the filter in web.xml by removing the comments around these lines: <filter-mapping> <filter-name>AccessLogFilter</filter-name> <url-pattern>/display/*</url-pattern> </filter-mapping> Enabling this AccessLogFilter will result in logging information being stored in the standard confluence log files. Advanced configurationAfter this is working, you could redirect the access log to a different file by adding a new RollingFileAppender at the top of log4j.properties: log4j.appender.accesslog=org.apache.log4j.RollingFileAppender To enable this logger, you need to add 'accesslog' to the log4j.rootLogger property, and change the AccessLogFilter logger line from 'confluencelog' to 'accesslog'. The web.xml url-pattern given above only matches page views (/display/*). You could change the url-pattern, or duplicate the entire filter-mapping to log access for different kinds of access (/admin/* for admin functions, /pages/* for edits and creates, etc. Note that /pages/editpage.action* doesn't work). What is loggedThe format produced is the following values separated by spaces: 1. Username or '-' if no user The above may be preceded by additional log4j-generated text, depending on the log4j pattern which is configured. Another option: Google AnalyticsGoogle Analytics can be easily integrated with Confluence for access tracking. After signing up, copy the Javascript and paste it into the 'Before end of <body>' section of Administration, Custom HTML. This will put the Javascript on every page generated by Confluence. This might not work correctly if your users are behind a firewall or authenticated proxy. |
![]() |
Document generated by Confluence on Oct 10, 2007 18:36 |