March 29, 2020
Estimated Post Reading Time ~

Overview of AEM Logs in detail - Part 1

Troubleshooting is the most important part of AEM. So to help in troubleshooting, AEM provides out of the box log files for different purposes:

Request.log
Access.log
Stdout.log
Stderr.log
Audit.log
History.log
Error.log
Upgrade.log


Log files in detail
1. Request.log: This log file contains each request together with response related to AEM instance. By this log file we can easily monitor the performance of AEM instance.

Each request contains the following information:
  • Method (GET, POST,HEAD,PUT,DELETE)
  • Resource Path (/content/geometrixx-outdoors/en.html)
  • Protocol (HTTP/1.1 or HTTPS)
Each response contains the following information:
  • Status Code (404,200,401 etc)
  • MIME Type: (text/html, image/jpeg etc)
  • Response Time (518 ms)

Fig- Request.log
By analyzing, we can easily determine that which request and response is taking too much time. By this we can increase overall site performance.

2. Access.log: This log file is almost similar to request.log. It helps us to know the following things:
  • Who is accessing
  • Which resource is being accessed
  • At what time resource is being accessed requests in access.log is exactly half of request.log because the access.log defines all the request and response in just one line.
Each line in Access.log contains the following information:
  • Access IP - The IP of that system from where the request is coming.
  • Access User - The user who is sending the request.
  • Access Time - At what time resource is being accessed.
  • Request Method- The method of the request like GET, POST, PUT etc.
  • Access Resource - The resource which is accessed by user.
  • Protocol like HTTP/1.1 or HTTPS
  • Response Status Code like - 404, 200, 401 etc.
  • Content Length - It determines the length of response content.
  • Referrer URL - The referrer is the web page that sends visitors to your site using a link. In other words, it’s the web page that a person was on right before they landed on your page.
  • User Agent- It refers to a web browser telling a website information about the browser and operating system.

Fig - Access Log 

3.Stdout.log: This log file basically contains the startup log. Here startup log means whenever any AEM instance created or started then it will hold the information about AEM instance like the sling.home, Apache sling etc.

Stdout.log is also useful to see the message given in java classes. This can be done by using System.out.println();
Even we can also able to see the log messages related to com.day.cq.mail.service.

Fig - Stdout log 

4. Stderr.log - This log file contains error messages of varying levels of severity. Some AEM instance related messages generated during startup Like: The JVM reports a heap size of 3618 MB, meets our expectation of 1024 MB +/- 20 . Note: By default the log level is set to Warning (WARN).


Fig- Stderr.log 

5. Audit.log- This log file is used by Jackrabbit to log changes to the repository. By default this log file is set to level info. There is not much logging going on at this level because of which audit.log seems to be empty. If you set this log file to log level debug you will see log messages every time you make changes to the repository. For example if you add a component to a page, delete a page etc.


Fig - Audit.log 

6.History.log: This log file contains the information about which action is performed on the content.
It contain high level logs about the actions performed by editors (actions can be edit, view, delete etc).This log is probably only relevant on author instances.

Each line contain the following information:
  • TimeStamp
  • Action
  • User
  • Content path
  • Content type(cq:page, dam:asset)
7. Upgrade.log - Provides a log of all upgrade operations that runs from com.day.compat.code upgrade and com.adobe.cq.upgradesexecutor package.By default, this log level is set to info.
8. Error.log - Error messages (of varying levels of severity like INFO, ERROR, DEBUG, etc.) are registered here.

Hierarchy of log4j logging levels are as follows in Highest to Lowest order
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
Note: The high-level logs contain all the logs of lower levels like in case of Trace log level, it will include all the logs of debugging, info, warn and error as well.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.