Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to configure a custom access.log format in AEM


Level 2

I currently have the standard LogManager configuration that writes an access.log file for AEM.

The value of Message Pattern ( is "{5}". This logs the standard NCSA extended/combined log format.

Now I want to add custom fields, as described in:

Apache Sling :: Client Request Logging

However, I cannot add these format strings in the system console LogManager configuration like that. If I try it just stops working.

As I understand it, the "{5}" is just a placeholder for the default message being logged by the logger (which in this case is NCSA).

My is configured to an SLF4J logger.

The way I understand the section about MDC in Apache Sling :: Logging it sounds like it should be possible to pass through some custom log message format strings to the logger.

Now I tried

%d{dd.MM.yyyy HH:mm:ss.SSS} *%p* %h %l %u %t "%r" %>s %b "%\{Referer}i" "%\{User-Agent}i" "%\{Host}i"

But this does not work, logging stops in the access log when I try this.

Can someone point out the proper way to enter the access log format string in the Message Pattern field in the system console?

And no, I don't want to write my own logger in code - I prefer to just configure it and move on debugging (so please do not point out links to documentation of how to write my own custom loggers, I'm aware of those).

3 Replies


Level 2

I have seen that link but it requires coding. As stated, I am looking for an option to simply configure it with the out of the box logger.

I just want to be able to modify the log format of the access log in the system console (e.g. like log format in Apache)


Level 10

Most of the custom logging requires you to map log to Java packages defined in code.