How to check AEM logs in the cloud (AEMaaCS)

Most of us have worked with AEM on prem and AMS (Adobe Manager Service) which require using SSH to connect to the system and searching for the desired logs, and then using tail to view the running logs. But SSH may not be possible on cloud instances. For tailing to work, we need to use the AIO CLI tool. You can check AEM logs in two ways listed below

 

Option 1 - Download logs files via cloud manager

Option 2 - Use Adobe IO CLI

 

Option 1 - Download log files

The first option is easy and straightforward. You can download logs by following these steps.

  1. Log into Cloud Manager at https://experience.adobe.com/#/@programName/cloud-manager/landing.html and select the appropriate organization and program.
  2. Navigate to the Environments
  3. You can download logs by selecting three dots and choosing Download Logs.

 

Option 2 - Adobe IO CLI

AEM logs can be accessed via the Adobe I/O CLI via Adobe Cloud Manager through the Adobe I/O CLI plugin for Adobe Cloud Manager.  You must first set up the Adobe I/O with the Cloud Manager plugin.

Identify the Program Id and Environment Id, and use list-available-log-options to list the log options that are used to tail or download logs. Here are the steps to follow:

 

Step 1 - Identify all programs in which you participate

$ aio cloudmanager:list-programs

Program Id Name      Enabled

14304      Program 1 true

11454      Program 2 true

11502      Program 3 true

 

 

Step 2 – The below command is used to identify a program using the program id you acquired in step 1

$ aio config:set cloudmanager_programid <PROGRAM ID>

 

 

Step 3 - Get a list of all the environments in your program. The following command will return all environments

$ aio cloudmanager:list-environments

Environment Id Name            Type  Description

22295          program-3-dev   dev

22310          program-3-prod  prod

22294          program-3-stage stage

 

Step 4 - The following command will list the available log files

 

$ aio cloudmanager:list-available-log-options <ENVIRONMENT ID>

Environment Id Service    Name

22295          author     aemaccess

22295          author     aemerror

22295          author     aemrequest

22295          publish    aemaccess

22295          publish    aemerror

22295          publish    aemrequest

22295          dispatcher httpdaccess

22295          dispatcher httpderror

22295          dispatcher aemdispatcher

 

Step 5 - Using the tail-logs command, Adobe I/O CLI provides the ability to tail logs in real-time from AEM as a Cloud Service. AEM as a Cloud Service tailing helps you keep track of real-time log activity as actions are performed.

 

$ aio config:set cloudmanager_programid <PROGRAM ID>

$ aio cloudmanager:tail-logs <ENVIRONMENT ID> <SERVICE> <NAME>

 If you are looking for specific log statements or statements of concern, you can use other command line tools in conjunction with tail-logs, like grep. Examples include:

$ aio cloudmanager:tail-logs 12345 author | grep com.example.MySlingModel

 The above command will only show log statements containing the string com.example.MySlingModel.

 

Downloading logs

AEM as a Cloud Service logs can be downloaded using Adobe I/O CLI's download-logs command. The download-logs command does the same thing as downloading logs from the Cloud Manager web UI, with the exception of consolidating logs over a number of days, as indicated on the request.


$ aio config:set cloudmanager_programid <PROGRAM ID>

$ aio cloudmanager:download-logs <ENVIRONMENT> <SERVICE> <NAME> <DAYS>

 

Note - Having multiple programs may require you to use the aio config:clear command to clear previously set program IDs

Comments