AEM Debugging & Log Analysis
Purpose
Systematically diagnose and resolve AEM issues using log analysis, debugging tools, error pattern recognition, and structured troubleshooting methodologies.
When to Use (Triggers)
- User mentions "debug," "error," "exception," "log analysis," or "troubleshoot"
- References to error.log, request.log, stack traces, or AEM error pages
- Questions about diagnosing specific exceptions, null pointers, or bundle issues
- Requests involving log configuration, log aggregation, or error patterns
- Discussion of AEM health problems, startup failures, or runtime errors
Core Capabilities
- Analyze AEM log files (error.log, request.log, access.log) for issue diagnosis
- Configure logging levels and custom loggers for targeted debugging
- Interpret common AEM exception patterns and their root causes
- Use debugging tools (remote debug, CRXDE Lite, OSGi console)
- Implement structured troubleshooting for complex multi-component issues
Domain Knowledge Required
Technical Foundation
- Log4j/SLF4J logging framework configuration and MDC context
- Java exception hierarchy and stack trace interpretation
- Remote debugging with JDWP (Java Debug Wire Protocol)
- Log aggregation patterns (ELK stack, Splunk, Azure Monitor)
AEM-Specific Context
- AEM log file locations and their purposes (error.log, request.log, stdout.log)
- Sling Log Support configuration via OSGi
- Common AEM exceptions and their meanings (ResourceNotFoundException, LoginException, etc.)
- OSGi bundle lifecycle states and troubleshooting (Installed, Resolved, Active)
- AEM Developer Tools (browser extension, CRXDE, System Console)
Implementation Approach
Step 1: Issue Classification
Categorize the problem for targeted investigation.
- Determine error type: startup failure, runtime exception, performance, data corruption
- Identify affected layer: OSGi, Sling, JCR, AEM application, dispatcher
- Check if issue is intermittent or consistent
- Establish timeline: when did the issue start, what changed
Step 2: Log Collection
Gather relevant log data for analysis.
- Collect error.log entries around issue timestamp
- Review request.log for associated HTTP requests and timing
- Check stdout.log for JVM-level issues (GC, OOM, native errors)
- Examine bundle startup logs for dependency resolution failures
Step 3: Log Analysis
Interpret log entries to identify root cause.
- Parse stack traces for originating code and nested exceptions
- Identify error patterns (frequency, correlation with user actions)
- Trace request flow through log correlation (request ID, session)
- Check for resource exhaustion (threads, connections, memory)
Step 4: Active Debugging
Use debugging tools for real-time investigation.
- Attach remote debugger to AEM JVM (port 5005 by default)
- Use CRXDE Lite for content inspection and quick fixes
- Check OSGi console for bundle states and service availability
- Inspect Sling Resource Resolution via Sling console
Step 5: Resolution & Prevention
Fix the issue and prevent recurrence.
- Implement fix based on identified root cause
- Add targeted logging for future diagnosis of similar issues
- Create monitoring/alerting for the failure condition
- Document the issue pattern and resolution for knowledge base
Quality Checklist
Related Skills
- aem-monitoring-alerting (proactive issue detection)
- aem-performance-tuning-profiling (performance-related debugging)
- aem-custom-osgi-services (service-level debugging)
Example Use Cases
- Bundle Resolution Failure: Diagnose an OSGi bundle stuck in "Installed" state by analyzing dependency resolution errors, identifying missing imports, and resolving version conflicts in Maven dependencies.
- Intermittent 500 Errors: Track down sporadic Internal Server Errors on publish using request.log correlation, error.log stack traces, and thread dump analysis revealing connection pool exhaustion.
- Post-Deployment Regression: Investigate functionality broken after deployment by comparing bundle versions, analyzing Sling Model registration errors, and identifying service ranking conflicts.
Notes
- Remote debugging on production is extremely risky — it pauses JVM threads. Use only as last resort.
- AEM Cloud Service logs are accessed via Cloud Manager or Adobe Experience League tools
- Configure custom loggers per package (not per class) to balance detail vs. log volume
- Request.log TIMER entries are AEM's built-in profiler — learn to read them
1---2name: aem-debugging-log-analysis3description: AEM Debugging & Log Analysis4---5# AEM Debugging & Log Analysis67## Purpose8Systematically diagnose and resolve AEM issues using log analysis, debugging tools, error pattern recognition, and structured troubleshooting methodologies.910## When to Use (Triggers)11- User mentions "debug," "error," "exception," "log analysis," or "troubleshoot"12- References to error.log, request.log, stack traces, or AEM error pages13- Questions about diagnosing specific exceptions, null pointers, or bundle issues14- Requests involving log configuration, log aggregation, or error patterns15- Discussion of AEM health problems, startup failures, or runtime errors1617## Core Capabilities18- Analyze AEM log files (error.log, request.log, access.log) for issue diagnosis19- Configure logging levels and custom loggers for targeted debugging20- Interpret common AEM exception patterns and their root causes21- Use debugging tools (remote debug, CRXDE Lite, OSGi console)22- Implement structured troubleshooting for complex multi-component issues2324## Domain Knowledge Required25### Technical Foundation26- Log4j/SLF4J logging framework configuration and MDC context27- Java exception hierarchy and stack trace interpretation28- Remote debugging with JDWP (Java Debug Wire Protocol)29- Log aggregation patterns (ELK stack, Splunk, Azure Monitor)3031### AEM-Specific Context32- AEM log file locations and their purposes (error.log, request.log, stdout.log)33- Sling Log Support configuration via OSGi34- Common AEM exceptions and their meanings (ResourceNotFoundException, LoginException, etc.)35- OSGi bundle lifecycle states and troubleshooting (Installed, Resolved, Active)36- AEM Developer Tools (browser extension, CRXDE, System Console)3738## Implementation Approach39### Step 1: Issue Classification40Categorize the problem for targeted investigation.41- Determine error type: startup failure, runtime exception, performance, data corruption42- Identify affected layer: OSGi, Sling, JCR, AEM application, dispatcher43- Check if issue is intermittent or consistent44- Establish timeline: when did the issue start, what changed4546### Step 2: Log Collection47Gather relevant log data for analysis.48- Collect error.log entries around issue timestamp49- Review request.log for associated HTTP requests and timing50- Check stdout.log for JVM-level issues (GC, OOM, native errors)51- Examine bundle startup logs for dependency resolution failures5253### Step 3: Log Analysis54Interpret log entries to identify root cause.55- Parse stack traces for originating code and nested exceptions56- Identify error patterns (frequency, correlation with user actions)57- Trace request flow through log correlation (request ID, session)58- Check for resource exhaustion (threads, connections, memory)5960### Step 4: Active Debugging61Use debugging tools for real-time investigation.62- Attach remote debugger to AEM JVM (port 5005 by default)63- Use CRXDE Lite for content inspection and quick fixes64- Check OSGi console for bundle states and service availability65- Inspect Sling Resource Resolution via Sling console6667### Step 5: Resolution & Prevention68Fix the issue and prevent recurrence.69- Implement fix based on identified root cause70- Add targeted logging for future diagnosis of similar issues71- Create monitoring/alerting for the failure condition72- Document the issue pattern and resolution for knowledge base7374## Quality Checklist75- [ ] Root cause identified with evidence (not just symptom addressed)76- [ ] Log entries clearly point to the issue origin77- [ ] Custom loggers configured for affected code paths78- [ ] Fix validated in test environment before production79- [ ] Monitoring added to detect recurrence80- [ ] Knowledge base updated with issue pattern81- [ ] Log levels restored to production-appropriate settings after debugging82- [ ] No sensitive data exposed in log output8384## Related Skills85- aem-monitoring-alerting (proactive issue detection)86- aem-performance-tuning-profiling (performance-related debugging)87- aem-custom-osgi-services (service-level debugging)8889## Example Use Cases901. **Bundle Resolution Failure:** Diagnose an OSGi bundle stuck in "Installed" state by analyzing dependency resolution errors, identifying missing imports, and resolving version conflicts in Maven dependencies.912. **Intermittent 500 Errors:** Track down sporadic Internal Server Errors on publish using request.log correlation, error.log stack traces, and thread dump analysis revealing connection pool exhaustion.923. **Post-Deployment Regression:** Investigate functionality broken after deployment by comparing bundle versions, analyzing Sling Model registration errors, and identifying service ranking conflicts.9394## Notes95- Remote debugging on production is extremely risky — it pauses JVM threads. Use only as last resort.96- AEM Cloud Service logs are accessed via Cloud Manager or Adobe Experience League tools97- Configure custom loggers per package (not per class) to balance detail vs. log volume98- Request.log TIMER entries are AEM's built-in profiler — learn to read them