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.
There is a simple AccessLogFilter in Confluence that 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.
After 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'.
上述の web.xml の url-pattern はページ ビュー (/display/*) にのみマッチします。url-pattern を変更したり、別の種類のアクセスをログするようにフィルターマッピング全体を複製したりすることができます (管理機能については /admin/*、編集および作成については /pages/* など。/pages/editpage.action* は動作しない点にご注意ください)。
The format produced is the following values separated by spaces:
1. Username or '-' if no user
2. URL
3. VM free memory at start of request (in KB)
4. Change in free memory after request is finished (in KB)
5. Time taken for request (in ms).
構成されている log4j パターンによっては、上述のログでは追加の log4j 生成テキストが先行している可能性があります。
Google Analytics can be easily integrated with Confluence for access tracking.
サインアップ後、JavaScript をコピーし、[管理] > [カスタム HTML] の "Before end of <body>" セクションにペーストします。これにより、Confluence が生成するすべてのページに JavaScript が含まれます。
ユーザーがファイアウォールや認証済みのプロキシの背後にいる場合、これは適切に動作しない可能性があります。