Decorative double Helix

How to Tail AEM, Dispatcher and CDN Logs on AEM as a Cloud Service

In order to monitor or debug AEM environments (or virtually any web environment) one needs data, and that data generally comes from server logs. The only way to aggregate all of the logs coming out of an instance in AEM as a Cloud Service is with Splunk, but if you don’t have that set up yet there a way

At this point, to get access to your AEM logs is one of two ways:

If one is doing active development on an AEM instance (particularly RDE environments which are typically used as shared dev environments for AEM development teams) even if one isn’t able to do critical time-correlation, graphing, historical queries, and all the other things you do with a log aggregator.

Additionally, because the logging needs to rattle through Adobe’s onboard Splunk instances there will be occasional lags between when the logs are generated on the AEM end and when they appear on the command line.

So, here are the steps to go through to tail logs on an AEM as a Cloud Service environment:

Step 1: Adobe IO Access for Cloud Manager

The first step you’ll want to check is to make sure your Adobe account is provisioned with access to create a service integration on Adobe IO with Cloud Manager. If you go to https://console.adobe.io with your Adobe ID and create a new project, select “Add an API”. You should see “Cloud Manager” under Experience Cloud in the list of integrations available to you.

What the Adobe IO console should look like if you have Cloud Manager access

In order to get into Adobe IO console, you will need to have “Developer” permissions on Cloud Manager, set up by your Adobe Admin Console administrator.

Step 2: Create an Adobe IO Project for your Cloud Manager (and logs) Access

Select OAuth Server-to-Server authentication as the type of authentication you’ll need. Previously the AIO plugin used JWT credentials, but these are being phased out by Adobe in favor of much-easier-to-implement-and-maintain OAuth.

Then, tell the integration what services it will get access to:

And then hit “SAVE CONFIGURED API”.

Step 3: Install the Adobe IO Runtime

This page gives the full installation instructions for installing the Adobe IO runtime. But in short, after installing NodeJS on your workstation, you:

$ npm install -g @adobe/aio-cli

Post install, you should see:

$ aio -v
@adobe/aio-cli/10.0.0 linux-x64 node-v20.10.0

Step 4: Install & Configure the Adobe IO Cloud Manager CLI Plugin

The full install instructions are here, but in short, run:

$ aio plugins:install @adobe/aio-cli-plugin-cloudmanager

Step 5: Select your Org & Environment

Authenticate to your environment with:

$ aio cloudmanager:org:select

Get your programID for the program you’re working in with:

$ aio cloudmanager:list-programs
 Program Id Name                                  Enabled 
 ────────── ───────────────────────────────────── ─────── 
 100007     TestCorp AEM Site				 true 

Set that program as your default program for AIO:

aio config:set cloudmanager_programid 100007

Authenticate to your environment with:

$ aio cloudmanager:list-environments
 Environment Id Name                                      Type Description 
 ────────────── ───────────────────────────────────────── ──── ─────────── 
 1000001        my-rde-env                                rde              
 1000003        my-dev-env                                dev  

Step 6: List Logs from an Environment

Note the number that each of your environments have as an Environment ID. If you use this ID you can list what logs are available for that environment.

Note that in addition to the AEM access, request and error logs and dispatcher logs that you’re used to, one can also tail the CDN logs here, which is huge for debugging cache-hit ratios and the like.

$ aio cloudmanager:list-available-log-options 1000003
 Environment Id Service    Name          
 ────────────── ────────── ───────────── 
 1000003        author     aemaccess     
 1000003        author     aemerror      
 1000003        author     aemrequest    
 1000003        author     cdn           
 1000003        publish    aemaccess     
 1000003        publish    aemerror      
 1000003        publish    aemrequest    
 1000003        publish    cdn           
 1000003        dispatcher httpdaccess   
 1000003        dispatcher httpderror    
 1000003        dispatcher aemdispatcher

Step 7: Tail the Desired Log

aio cloudmanager:tail-log 1000003 author aemacces
[cm-p1234-e10001-aem-author-674d744bf5-q862v] *INFO* [67.189.6.206 [1591669210392] POST /content/dam.initiateUpload.json HTTP/1.1] com.adobe.cq.assetcompute.impl.servlet.InitiateUploadAssetServlet initiate upload asset: Mountain Biking the Uetliberg in Zurich.mp4, size: 74013446, mimeType: video/mp4 09.06.2020 02:20:10.397 [cm-p1234-e10001-aem-author-674d744bf5-q862v] *INFO* [67.189.6.206 [1591669210392] POST /content/dam.initiateUpload.json HTTP/1.1] com.adobe.cq.assetcompute.impl.servlet.InitiateUploadAssetServlet initiate upload complete asset : Mountain Biking the Uetliberg in Zurich.mp4, size: 74013446, mimeType: video/mp4

It’s cumbersome, it has a lot of steps, and no, it’s not Splunk. But it’s far better than nothing and is definitely needed if you’ll be doing any sort of development work on the instance.

Hopefully this helps you out!

About The Author

Tad Reeves

Principal Architect at Arbory Digital

AEM Architect & DevOps guy with 14 years experience on AEM/CQ and 25+ years in systems infrastructure.

Contact Tad on Linkedin

Like what you heard? Have questions about what’s right for you? We’d love to talk! Contact Us

Podcast Episodes

Podcast: The Crossroads of AEM Platform Choices - AEM 6.5 vs AEMaaCS vs EDS

Arbory Digital now has a technical AEM Podcasts! Raf & Tad dive into how to decide you have the right digital experience platform

Is Self-Hosted Aem Still A Thing?

Is it still possible (or advisable) to host Adobe Experience Manager outside of Adobe? Tad Reeves and Joey Smith get into it!

Optimizing Site Performance in China for AEM & other platforms
How much do you know about the tools at your disposal to optimize your site's performance in mainland China? And even if you don't have a Chinese-language site, do you need to be concerned with in-China performance? YOU DO!