Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing AEM 6.2 error logs over HTTP

Tags:

aem

In previous versions of AEM, certainly in CQ 5.6 and AEM 6.0, it was possible to tail the error logs over HTTP, without connecting to the server over SSH.

For example, I could get the last 1000 lines from the error log of my AEM author instance by calling:

http://localhost:4502/bin/crxde/logs?tail=1000

This seems to no longer be possible in AEM 6.2, this path does not resolve to anything.

Is there another way I could still tail the log over HTTP?

like image 464
toniedzwiedz Avatar asked Jan 26 '17 18:01

toniedzwiedz


2 Answers

A colleague answered this question for me on a chat so I'm putting it here to make it easier to find in the future.

There's now a neat utility in the OSGi console that allows one to view the logs as well as configure the various loggers. You can find it at http://localhost:4502/system/console/slinglog

Adobe Experience Manager Web Console Log Support

The Appender tab provides links to the various log files that can be used to load logs over HTTP.

Here's an example request it makes:

http://localhost:4502/system/console/slinglog/tailer.txt?tail=1000&name=%2Flogs%2Ferror.log

As you can see, both the log file name and the tail parameter can be specified. You can also use grep with both simple phrases and regular expressions.

This is a built-in feature of Apache Sling.

like image 181
toniedzwiedz Avatar answered Sep 23 '22 05:09

toniedzwiedz


In addition FYI, you can also find the status-slinglogs where you can perform log file downloads in a zip and logger actions in a txt to your local at /system/console/status-slinglogs

http://localhost:4502/system/console/status-slinglogs

enter image description here

and the direct urls for the downloading these zip files are as below http://localhost:4502/system/console/status-slinglogs.zip

http://localhost:4502/system/console/status-slinglogs/configuration-status-20170126-183246.zip (where as 20170126-183246 is and time stamp)

like image 22
VAr Avatar answered Sep 25 '22 05:09

VAr