ログ作成の設定

このページの内容

お困りですか?

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

コミュニティに質問

特に、特定の問題のトラブルシューティング時に Confluence アプリケーション ログに書き込まれる内容を変更する必要があるなど、さまざまな状況があります。 

Confluence の実行中に、[ロギングとプロファイリング] 画面でログ作成動作を一時的に変更できます。Confluence を再起動すると、変更は破棄されます。 

Alternatively, you can permanently change the logging behaviour in the log4j configuration file, log4j2.xml . 

Confluence 11.0 and later: Confluence uses a native Apache Log4j 2 configuration file, log4j2.xml . The Log4j 1 log4j.properties  and log4j-diagnostic.properties  files, and the burstFilterConfig.properties  file, are no longer read. If you customized any of these files in an earlier version, you must recreate your changes in log4j2.xml .


On this page:

Terminology: In log4j 2, a 'logger' is a named entity. Logger names are case-sensitive and they follow a hierarchical naming standard. For example, the logger named com.foo is a parent of the logger named com.foo.bar.

Confluence 動作中にログ作成動作を一時的に変更する

問題のトラブルシューティングを行う場合、Confluence の実行中にログ作成動作を一時的に変更できます。これらの変更は log4j2.xml ファイルには書き込まれないため、Confluence を次回停止したときに破棄されます。

既存のクラスまたはパッケージのログ レベルを変更する

これを実行するには、システム管理者グローバル権限が必要です。特定のレベルについては、「4j ログ作成レベル 」を参照してください。 

既存のクラスまたはパッケージのログ レベルを変更するには、次の手順を実行します。

  1. [管理] メニュー に移動して、[一般設定] > [ログとプロファイルの作成] の順に選択します。
  2. Confluence をクラスタで実行する場合は、クラスタ ノードを選択します。
  3. 関連するクラスまたはパッケージを探し、[New Level (新しいレベル)] ドロップダウンから値を選択します。
  4. 変更を [保存] します。

または、特定のクラスまたはパッケージのログ作成を停止する場合は、[削除] を選択します。

変更は log4j.properties ファイルには書き込まれないため、Confluence を次回停止したときに破棄されます。

追加のクラスまたはパッケージのログ作成を追加する

Atlassian のサポート チームは、特定の問題のトラブルシューティングを行う際、追加のログ作成を有効にするように依頼する場合があります。これを実行するには、システム管理者グローバル権限が必要です。 

新しいクラスまたはパッケージのログ レベルを設定するには、次の手順を実行します。

  1. [管理] メニュー に移動して、[一般設定] > [ログとプロファイルの作成] の順に選択します。
  2. Confluence をクラスタで実行する場合は、クラスタ ノードを選択します。
  3. [クラス/パッケージ名] フィールドに名前を入力します。これは com.atlassian.confluence.example のようになります。
  4. [エントリの追加] を選択して、新しいクラスまたはパッケージをリストに追加します。
  5. 関連するクラスまたはパッケージを探し、[New Level (新しいレベル)] ドロップダウンから値を選択します。
  6. 変更を保存します。


ページ プロファイル作成のオンまたはオフ

ページ プロファイリングの使用タイミングと使用方法の詳細は、「ページ リクエスト プロファイリングを使用してパフォーマンス低下をトラブルシューティングする」を参照してください。 

詳細な SQL ログ作成のオンまたはオフ

詳細な SQL ログ作成の使用タイミングと使用方法の詳細は、「詳細 SQL ログ作成の有効化」を参照してください。

事前設定されたログ作成構成

Confluence では、事前設定された 2 つのログ構成方法を提供します。

  • 本番環境
    これは推奨されるデフォルト設定で、ログをフラッディングすることなく最も重要な情報を提供することを目的としています。 
  • 診断
    これは、ほとんどのパッケージのログ レベルをデバッグに変更します。トラブルシューティング時には便利ですが、パフォーマンスが低下し、ログファイルがより迅速にいっぱいになります。

ログ作成構成をデフォルトにリセットする場合は、[本番環境] を選択します。


スクリーンショット: ログレベルの変更とプロファイル作成 

Permanently change logging level in the configuration XML file

これを行うには、インストール ディレクトリにアクセスする必要があります。 

log4j2.xml ファイルには、すべてのデフォルトのクラスとパッケージ、および有効にするように選択できる追加のパッケージが一覧表示されます。 

 クラスまたはパッケージのログ レベルを永続的に変更するには、次の手順を実行します。

  1. Confluence を停止します。
  2. <CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/log4j2.xml ファイルを編集します。
  3. In the <Loggers>  section, locate the <Logger>  element for the package you want to change. If the element is commented out, remove the surrounding <!--  and -->  to enable it.
  4. Change the logging level to DEBUG, INFO, WARN, ERROR, or FATAL. See log4j Logging Levels for accepted values. For example: 
    <Logger level="debug" name="com.atlassian.confluence.cache"/>
  5. ファイルを保存し、Confluence を再起動して変更を有効にします。

If a logger also has additivity="false"  and an <AppenderRef> , its messages go only to that appender's log file. Keep these when you change the level. For example, this logger writes only to atlassian-confluence-index.log :

<Logger level="info" name="com.atlassian.confluence.internal.index" additivity="false">
  <AppenderRef ref="indexlog"/>
</Logger>

Confluence をクラスタで実行している場合は、すべてのノードで変更を繰り返す必要があります。各ノードを 1 つずつ下げることができます。クラスタ全体を停止する必要はありません。

If you want to log a class or package that's not already listed, simply add it to the file.  See the log4j 2 documentation for more information. 

ログの場所、番号、サイズを変更する場合は、「Confluence ログを使用する」を参照してください。

logging.properties で java.util.logging のレベルを設定する

Confluence では、log4j や slf4j ではなく java.util.logging を使用するライブラリをいくつか使用しています。該当するライブラリは以下のとおりです。

  • com.sun.jersey
  • org.apache.shindig

Confluence の logging.properties ファイルは、特定のレベルの java.util.logging を slf4j 経由で log4j にリダイレクトするように設定されています。

これらのライブラリのログ レベルを上げるには、まず <CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/ にある logging.properties ファイルを設定する必要があります。ログ レベルは log4j とは異なります。詳細な手順については、Java 11 ドキュメントの java.util.logging を参照してください。

たとえば、shindig のログ レベルを上げるには、logging.properties ファイル内の次の行を変更します。

org.apache.shindig.level = INFO

to

org.apache.shindig.level = FINE

その後、同様に上述のいずれかの方法を使用して log4j レベルを設定します。

ロガーのバースト制限を設定する

Confluence allows burst limiting on loggers by using the log4j 2 BurstFilter implementation. Learn more about this mechanism

Confluence 11.0 and later: burst limiting is configured directly in log4j2.xml . The burstFilterConfig.properties  file used in earlier versions is no longer read.

特定のロガーにバースト制限を追加するには、次の手順を実行します。

  1. Confluence を停止します。
  2. \<CONFLUENCE-INSTALL>/confluence/WEB-INF/classes/log4j2.xml ファイルを編集します。
  3. In the <Loggers>  section, add a <BurstFilter>  element inside the <Logger>  element for the logger you want to limit. If there is no <Logger>  element for it yet, add one. Use the following configuration as an example, where:
       - name  is the class or package name of the logger.
       - level  is the log level at which we filter logs. Anything at or below this level is subject to filtering.
       - rate  is the average number of events we allow per second.
       - maxBurst  is the maximum number of events that can occur before filtering starts. 

    <Logger name="{loggerName}">
      <BurstFilter level="WARN" rate="0.5" maxBurst="5"/>
    </Logger>

    For example, Confluence ships with this configuration: 

    <Logger name="com.atlassian.analytics.client.pipeline.PipelineExecutionService">
      <BurstFilter level="WARN" rate="0.5" maxBurst="5"/>
    </Logger>
  4. ファイルを保存し、Confluence を再起動して変更を有効にします。
最終更新日: 2026 年 10 月 9 日

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

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