ロギングとプロファイリング
ログ ファイルの場所
ログは Jira アプリケーションのホーム ディレクトリのlog
サブディレクトリ (別の場所を設定した場合はそのディレクトリ) に書き込まれます。atlassian-jira.log
の場所は、[システム情報] ページの [ファイル パス] セクションで確認できます。- セキュリティ関連情報 (例: ログイン、ログアウト、セッション作成 / 破棄、セキュリティ拒否) が
atlassian-jira-security.log
に書き込まれます。
ログの場所を変更する
In the log4j2.xml
file (located in the Jira application installation directory), change the following section from this:
<JiraHomeAppender name="filelog"
fileName="atlassian-jira.log"
filePattern="atlassian-jira.log.%i">
<PatternLayout alwaysWriteExceptions="false">
<Pattern>${StackTraceFilteringPattern}</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="20480 KB"/>
</Policies>
<DefaultRolloverStrategy fileIndex="min" max="10"/>
</JiraHomeAppender>
... to this (replacing <LOG_PATH>
with your preferred locations) :
<RollingFile name="filelog"
fileName="<YOUR LOGFILE PATH>"
filePattern="<YOUR LOGFILE PATH>.%i">
<PatternLayout alwaysWriteExceptions="false">
<Pattern>${StackTraceFilteringPattern}</Pattern>
</PatternLayout>
<Policies>
<SizeBasedTriggeringPolicy size="20480 KB"/>
</Policies>
<DefaultRolloverStrategy fileIndex="min" max="10"/>
</RollingFile>
If you want to make additional changes to the appender configuration, see Log4j — Log4j 2 Appenders.
If you change the location of your log files, they will no longer be included when you generate a support zip. This means you'll need to attach your logs to any support requests manually.
ログ レベル
log4j には、'DEBUG', 'INFO', 'WARN', 'ERROR'
、および 'FATAL'
の 5 つのログ レベルがあります。各ログ レベルは 1 つ下のログ レベルよりも多くのログ情報を提供します。
- 「DEBUG」
- 「INFO」
- 「WARN」
- 「ERROR」
- 「FATAL」
「DEBUG」は最も詳細なログを提供し、「FATAL」は最低限のログを提供します。デフォルトのレベルは WARN が設定されており、警告とエラーが表示されます。より詳細を見るときは、このレベルを調整すると便利です。注意: 「DEBUG」を設定するとユーザ パスワードがログに記録されてしまう可能性があります。
デフォルトのログ レベルは一時的または恒久的に変更することができます。
For example, when troubleshooting, you might temporarily change the logging level from 'WARNING' to 'INFO' so as to get a more detailed error message or a stack trace. If you are unsure of which logging categories to adjust, the most helpful information generally comes from the Root and the com.atlassian
loggers.
ログ レベルを一時的に変更する
- 上部のナビゲーション バーから [管理者 ] > [システム] を選択します。
- システム サポート > ロギングとプロファイリング を選択してログページを開くと、定義済みのすべての log4j カテゴリ (パッケージ名として) と現在のログレベルが表示されます。
- カテゴリーのログ レベルを変更するには、該当するパッケージ名に関連付けられたログ レベルのリンクをクリックします。カテゴリーのログをオフにするには、該当するパッケージ名に関連付けられた「オフ」リンクをクリックします。
ログ レベルを恒久的に変更する
log4j2.xml
ファイル (Jira アプリケーションのインストール ディレクトリ) を編集します。Locate the section and make your changes (for example, change
WARN
toDEBUG
):<Logger name="com.atlassian" level="WARN" additivity="false"> <AppenderRef ref="filelog"/> </Logger>
The
log42j.xml
file that ships with Jira has the default logging levels specified.For more information about Log4j 2 (for example, how to define new logging categories), and about the format of the
log4j2.xml
file, see Log4j — Apache Log4j 2.- Jira を再起動します。
If your application server configures logging itself, you may need to remove the log4j.properties
file. You may also need to remove the entire log4j.jar
file to get logging to work.
プロファイリング
Jira でパフォーマンスに関する問題が発生した場合、パフォーマンスの低下がどこで起こっているかを確認することが一般に有用です。このためには、以下に示すようにプロファイリングを有効にした後、リクエストごとに Jira が生成するパフォーマンス トレースを分析します。プロファイリング トレースは、10 分の 1 ミリ秒単位で消費時間をレポートします。
Profiling information is available in the atlassian-jira-profiler.log file.
プロファイリング トレースの例を示します。
[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 はプロファイリング トレースを開始し、atlassian-jira-profiler.log ファイルにデータを生成します。
- プロファイリングを「オフ」にするには、「プロファイリングの無効化」リンクをクリックします。
恒久的にプロファイリングを有効化する
- Jira のインストール ディレクトリで、
atlassian-jira/WEB-INF/web.xml
ファイルを編集します。 以下のエントリを探します。
<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 "false" --> <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 "false" --> <param-name>autostart</param-name> <param-value>true</param-value> </init-param>
- ファイルを保存します。プロファイリングは Jira を再起動すると有効になり、atlassian-jira-profiler.log ファイルでプロファイリング情報を確認できるようになります。