ロギングとプロファイリング
ログ ファイルの場所
The logs are written to thelog
subdirectory of your JIRA application home directory (or elsewhere if you have configured a different location). You can view the location of the atlassian-jira.log
in the 'File Paths' section of the system information page.- セキュリティ関連情報 (例: ログイン、ログアウト、セッション作成 / 破棄、セキュリティ拒否) が
atlassian-jira-security.log
に書き込まれます。
ログの場所を変更する
In the log4j.properties
file (located in the JIRA application installation directory):
以下の行を
log4j.appender.filelog=com.atlassian.jira.logging.JiraHomeAppender
以下のように変更します。
log4j.appender.filelog=org.apache.log4j.RollingFileAppender
以下の行をログファイルの新しい場所を指定するように変更します。
log4j.appender.filelog.File=atlassian-jira.log
ログ レベル
log4j には、'DEBUG', 'INFO', 'WARN', 'ERROR'
、および 'FATAL'
の 5 つのログ レベルがあります。各ログ レベルは 1 つ下のログ レベルよりも多くのログ情報を提供します。
- 「DEBUG」
- 「INFO」
- 「WARN」
- 「ERROR」
- 「FATAL」
「DEBUG」は最も詳細なログを提供し、「FATAL」は最低限のログを提供します。デフォルトのレベルは WARN が設定されており、警告とエラーが表示されます。より詳細を見るときは、このレベルを調整すると便利です。
注意: 「DEBUG」を設定するとユーザ パスワードがログに記録されてしまう可能性があります。
デフォルトのログ レベルは一時的または恒久的に変更することができます。
例えばトラブルシューティングの際、ログ レベルを "WARNING" から "INFO" に一時的に変更して、より詳細なエラー メッセージやスタック トレースを取得することができます。必要なログ カテゴリが不明な場合、一般に log4j.rootLogger
カテゴリや log4j
<category>.com.atlassian
カテゴリで有用な情報を取得できます。
ログ レベルを一時的に変更する
- > [システム] の順に選択します。
- システム サポート > ロギングとプロファイリング を選択してログページを開くと、定義済みのすべての log4j カテゴリ (パッケージ名として) と現在のログレベルが表示されます。
- カテゴリーのログ レベルを変更するには、該当するパッケージ名に関連付けられたログ レベルのリンクをクリックします。カテゴリーのログをオフにするには、該当するパッケージ名に関連付けられた「オフ」リンクをクリックします。
ログ レベルを恒久的に変更する
- Edit the
log4j.properties
file (located in the JIRA application installation directory). 以下の部分に移動します。
log4j.logger.com.atlassian = WARN, console, filelog log4j.additivity.com.atlassian = false
and make your desired changes (e.g. change the
WARN
toDEBUG
).
Thelog4j.properties
file that ships with JIRA has the default logging levels specified. For more information about log4j (e.g. how to define new logging categories), and about the format of thelog4j.properties
file, please refer to the documentation on the log4j site.- Jira を再起動します。
注: アプリケーション サーバー自体でログが設定されている場合、log4j.properties
ファイルの削除が必要な場合があります。また、ログを機能させるために、log4j.jar
ファイル全体の削除が必要なこともあります。
プロファイリング
JIRA でパフォーマンスに関する問題が発生した場合、パフォーマンスの低下がどこで起こっているかを確認することが一般的に有用です。そのためには、次のようにプロファイリングを有効にした後、リクエストに対して JIRA によって生成されるパフォーマンストレースを分析します。次に、プロファイリングトレースの例を示します。
[Filter: profiling] Turning filter on [jira_profile=on]
[116ms] - /secure/Dashboard.jspa
[5ms] - IssueManager.execute()
[5ms] - IssueManager.execute()
[5ms] - Searching Issues
[29ms] - IssueManager.execute()
[29ms] - IssueManager.execute()
[29ms] - Searching Issues
[28ms] - Lucene Query
[23ms] - Lucene Search
プロファイリングは一時的または恒久的に有効化することができます。
一時的にプロファイリングを有効化する
- > [システム] の順に選択します。
- システム サポート > ロギングとプロファイリング を選択してログページを開くと、定義済みのすべての log4j カテゴリ (パッケージ名として) と現在のログレベルが表示されます。
- ページの一番下の「プロファイリング」セクションまでスクロールします。このセクションはプロファイリングが現在「オン」または「オフ」になっているかどうかを示し、プロファイリングをそれぞれ「無効化」または「有効化」するリンクを提供します。
- プロファイリングを「オン」にするには、「プロファイリングの有効化」リンクをクリックします。JIRA はログにプロファイリングの追跡情報の生成を始めます。
- プロファイリングを「オフ」にするには、「プロファイリングの無効化」リンクをクリックします。
恒久的にプロファイリングを有効化する
- In your JIRA installation directory, edit the
atlassian-jira/WEB-INF/web.xml
file. 以下のエントリを探します。
<filter> <filter-name>profiling</filter-name> <filter-class>com.atlassian.jira.web.filters.JIRAProfilingFilter</filter-class> <init-param> <!-- specify the which HTTP parameter to use to turn the filter on or off --> <!-- if not specified - defaults to "profile.filter" --> <param-name>activate.param</param-name> <param-value>jira_profile</param-value> </init-param> <init-param> <!-- specify the whether to start the filter automatically --> <!-- if not specified - defaults to "true" --> <param-name>autostart</param-name> <param-value>false</param-value> </init-param> </filter>
autostart
パラメーターを false ではなく true に変更します。<init-param> <!-- specify the whether to start the filter automatically --> <!-- if not specified - defaults to "true" --> <param-name>autostart</param-name> <param-value>true</param-value> </init-param>
- ファイルを保存します。JIRA を再起動すると、プロファイリングが有効になります。