How to enable API access logging in Confluence

お困りですか?

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

コミュニティに質問

(warning) The below configuration works before 7.14.x. From 7.15.x, there is no need to enable <filters> in web.xml

目的

API calls are not logged by default in Confluence. You might want to enable this logging to debug any REST/XML-RPC related issues you are seeing.

ソリューション

メモ:

  • This is very similar to our documentation on how to enable user access logging. We will just make some tweaks to the URL patterns provided
  • Please do not modify the application-wide web descriptor, $server/conf/web.xml. This will be ineffective and potentially may break Confluence. 

To enable the AccessLogFilter:

  1. Uncomment this line in confluence/WEB-INF/classes/log4j.properties:

    log4j.category.com.atlassian.confluence.util.AccessLogFilter=INFO
    
  2. Enable the filter in confluence/WEB-INF/web.xml by removing the comments around these lines (or adding if they are not included):

            <filter-mapping>
                <filter-name>AccessLogFilter</filter-name>
                <url-pattern>/rest/*</url-pattern>
            </filter-mapping>
    
            <filter-mapping>
                <filter-name>AccessLogFilter</filter-name>
                <url-pattern>/rpc/*</url-pattern>
            </filter-mapping>
     
            <filter-mapping>
                <filter-name>AccessLogFilter</filter-name>
                <url-pattern>/soap/*</url-pattern>
            </filter-mapping>

    This combination of URL patterns will work for REST, XML-RPC, and SOAP API calls. You can further modify the pattern by adjusting the url-pattern field if you see any other URL patterns used in API calls that are not included in the above. For example, if you only want to capture REST calls for Team Calendars only, you can filter it as follows:

            <filter-mapping>
                <filter-name>AccessLogFilter</filter-name>
                <url-pattern>/rest/calendar-services/*</url-pattern>
            </filter-mapping>
    


最終更新日 2023 年 5 月 25 日

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

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