Often, for auditing purposes, administrators need to know who did what on their Confluence site. Notifications are not ideally suited for this purpose. 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.
Instead, you can generate a basic log indicating which users are accessing which pages in Confluence. Confluence has a built-in access logging mechanism that shows the user and URL invoked. To enable it, you need to modify a couple of configuration files and restart Confluence.
There is a simple AccessLogFilter in Confluence than can be enabled via
Note: Please do not modify the application-wide web descriptor,
$server/conf/web.xml. This will be ineffective and potentially may break Confluence.
To enable user access logging:
Uncomment this line in
Enable the filter in
confluence/WEB-INF/web.xmlby removing the comments around these lines:
Notice that the *.action pattern is added optionally to log the actions of Confluence in addition to the page views, such as user logins by specifying login.action. This combination of URL patterns will work for all URLs. You can further modify the pattern by adjusting the
An alternative filter: For troubleshooting purposes, often it is useful to capture all accesses to Confluence. To do this use the following filter mapping in
confluence/WEB-INF/web.xmlinstead of the above:
- Restart Confluence.
Logging information being stored in the
atlassian-confluence.log file in the Confluence Home directory.
You can choose to redirect the access log to a different file by adding a new RollingFileAppender at the top of
Find this line:
Change it to this:
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).
로깅 되는 대상
The log file will contain the following values separated by spaces:
- Thread name
- Username or '-' if no user
- VM free memory at start of request (in KB)
- Change in free memory after request is finished (in KB)
- Time taken for request (in ms).
- Remote address
The above may be preceded by additional log4j-generated text, depending on the log4j pattern which is configured.
Google Analytics can be easily integrated with Confluence for access tracking.
This might not work correctly if your users are behind a firewall or authenticated proxy.
For more information on using Google Analytics with Confluence you may wish to refer to this blog post by David Simpson.
Tomcat Valve Component access log
Path must contain forward slashes '/', not backward slashes.This note is particularaly relevant for Windows Users. When configuring the log4j logging options, each backslash in your path must be written as a forward slash. For example, this path:
must be written as: