How to enable API access logging in Confluence

Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

⚠️ 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.

Solution

Notes:

  • 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:

    1 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):

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 <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:

    1 2 3 4 <filter-mapping> <filter-name>AccessLogFilter</filter-name> <url-pattern>/rest/calendar-services/*</url-pattern> </filter-mapping>
Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.