Confluence 2.6 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
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.
AccessLogFilter の構成
There is a simple AccessLogFilter in Confluence than can be enabled via confluence/WEB-INF/classes/log4j.properties
and confluence/WEB-INF/web.xml
.
You need to uncomment these lines in log4j.properties:
log4j.category.com.atlassian.confluence.util.AccessLogFilter=INFO, confluencelog
log4j.additivity.com.atlassian.confluence.util.AccessLogFilter=false
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
log4j.appender.accesslog.Threshold=DEBUG
log4j.appender.accesslog.File=${catalina.home}/logs/atlassian-confluence-access.log
log4j.appender.accesslog.MaxFileSize=20480KB
log4j.appender.accesslog.MaxBackupIndex=5
log4j.appender.accesslog.layout=com.atlassian.confluence.util.PatternLayoutWithStackTrace
log4j.appender.accesslog.layout.ConversionPattern=%d %p [%c{4}] %M %m%n
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* は動作しない点にご注意ください)。
What is logged
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 生成テキストが先行している可能性があります。
Another option: Google Analytics
Google Analytics can be easily integrated with Confluence for access tracking.
サインアップ後、JavaScript をコピーし、[管理] > [カスタム HTML] の "Before end of <body>" セクションにペーストします。これにより、Confluence が生成するすべてのページに JavaScript が含まれます。
ユーザーがファイアウォールや認証済みのプロキシの背後にいる場合、これは適切に動作しない可能性があります。
Analyze Access Logs
You can analyse access logs through a log file analyser such as AWStats, or manually look through for pages which are slow to load.