ロギングとプロファイリング

システム管理

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

ログ

Jira では、実行時のログのために log4j という強力なログモジュールを使用します。

次のすべての手順を行うには、Jira システム管理者グローバル権限を持つユーザーとしてログインする必要があります。

ログ ファイルの場所

ログは Jira アプリケーションのホーム ディレクトリlog サブディレクトリ (別の場所を設定した場合はそのディレクトリ) に書き込まれます。atlassian-jira.log の場所は、[システム情報] ページの [ファイル パス] セクションで確認できます。
  • セキュリティ関連情報 (例: ログイン、ログアウト、セッション作成 / 破棄、セキュリティ拒否) が atlassian-jira-security.log に書き込まれます。

ログの場所を変更する

Jira アプリケーションのインストール ディレクトリlog4j.properties ファイルで、次の操作を行います。

  1. 以下の行を

    log4j.appender.filelog=com.atlassian.jira.logging.JiraHomeAppender
    

    以下のように変更します。

    log4j.appender.filelog=org.apache.log4j.RollingFileAppender
    
  2. 以下の行をログファイルの新しい場所を指定するように変更します。

    log4j.appender.filelog.File=atlassian-jira.log

ログ レベル

log4j には、'DEBUG', 'INFO', 'WARN', 'ERROR'、および 'FATAL' の 5 つのログ レベルがあります。各ログ レベルは 1 つ下のログ レベルよりも多くのログ情報を提供します。

  • 「DEBUG」
  • 「INFO」
  • 「WARN」
  • 「ERROR」
  • 「FATAL」

'DEBUG' provides the most verbose logging and 'FATAL' provides the least verbose logging. The default level is WARN, meaning warnings and errors are displayed. Sometimes it is useful to adjust this level to see more detail.
(warning) Please be aware: the 'DEBUG' setting may cause user passwords to be logged.

デフォルトのログ レベルは一時的または恒久的に変更することができます。

  • 一時的 — 変更したログレベルは Jira を再起動すると元に戻ります。
  • 恒久的 — 変更したログレベルは Jira を再起動してもそのまま保持されます。

例えばトラブルシューティングの際、ログ レベルを "WARNING" から "INFO" に一時的に変更して、より詳細なエラー メッセージやスタック トレースを取得することができます。必要なログ カテゴリが不明な場合、一般に log4j.rootLogger カテゴリや log4j<category>.com.atlassian カテゴリで有用な情報を取得できます。

ログ レベルを一時的に変更する

  1. In the upper-right corner of the screen, select Administration > System
  2. システム サポート > ロギングとプロファイリング を選択してログページを開くと、定義済みのすべての log4j カテゴリ (パッケージ名として) と現在のログレベルが表示されます。
  3. カテゴリーのログ レベルを変更するには、該当するパッケージ名に関連付けられたログ レベルのリンクをクリックします。カテゴリーのログをオフにするには、該当するパッケージ名に関連付けられた「オフ」リンクをクリックします。

ログ レベルを恒久的に変更する

  1. log4j.properties ファイル (Jira アプリケーションのインストール ディレクトリ) を編集します。
  2. 以下の部分に移動します。

    log4j.logger.com.atlassian = WARN, console, filelog
    log4j.additivity.com.atlassian = false
    

    and make your desired changes (e.g. change the WARN to DEBUG).
    (info) The log4j.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 the log4j.properties file, please refer to the documentation on the log4j site.

  3. Jira を再起動します。

(info) Please note: 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 によって生成されるパフォーマンストレースを分析します。次に、プロファイリングトレースの例を示します。

[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

プロファイリングは一時的または恒久的に有効化することができます。

  • 一時的 — プロファイリングは次に Jira を再起動するまで有効になります。
  • 恒久的 — プロファイリングは Jira を再起動しても有効のままとなります。

一時的にプロファイリングを有効化する

  1. In the upper-right corner of the screen, select Administration > System
  2. システム サポート > ロギングとプロファイリング を選択してログページを開くと、定義済みのすべての log4j カテゴリ (パッケージ名として) と現在のログレベルが表示されます。
  3. ページの一番下の「プロファイリング」セクションまでスクロールします。このセクションはプロファイリングが現在「オン」または「オフ」になっているかどうかを示し、プロファイリングをそれぞれ「無効化」または「有効化」するリンクを提供します。
    • プロファイリングを「オン」にするには、「プロファイリングの有効化」リンクをクリックします。Jira はログにプロファイリングの追跡情報の生成を始めます。
    • プロファイリングを「オフ」にするには、「プロファイリングの無効化」リンクをクリックします。

恒久的にプロファイリングを有効化する

  1. Jira のインストール ディレクトリで、atlassian-jira/WEB-INF/web.xml ファイルを編集します。
  2. 以下のエントリを探します。

            <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>
    
  3. 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>
    
  4. ファイルを保存します。Jira を再起動すると、プロファイリングが有効になります。
最終更新日: 2019 年 10 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.