-
Notifications
You must be signed in to change notification settings - Fork 27
Getting Started with Log Aggregation
Monitoring is an essential part of maintaining the health and performance of any application. Acting on issues identified by the logging framework ensures that your systems stay reliable and performant. However, actively reviewing log files or email notifications can quickly become overwhelming, especially for applications with frequent issues. Over time, email alerts are often ignored or filtered, defeating the purpose of proactive monitoring.
Log Aggregation simplifies this process by leveraging RFLIB's application event functionality to aggregate published events with log levels of WARN, ERROR, or FATAL. This aggregation helps operations teams identify areas of concern more efficiently, allowing them to prioritize efforts and resolve critical issues faster.
Log Aggregation is configured using the Log Aggregation Log Level custom setting in the Logger Settings Custom Settings object. To enable the feature:
- Navigate to the Logger Settings tab in RFLIB's Ops Center or go to the Logger Settings Custom Settings in Salesforce Setup.
- Set the Log Aggregation Log Level to one of the following values:
- WARN: Captures warning events.
- ERROR: Captures error events.
- FATAL: Captures only the most severe issues.
Once enabled, this setting will create entries in the Application Event Log Custom Object whenever a log event matches the specified log level. These entries can be viewed and analyzed using the Application Event Dashboard.
Additionally, the name of each log event follows a specific pattern to make the events easily identifiable. The naming convention is defined by the following format:
rflib-{logLevel}-{context}
-
logLevel: The log level of the event, such as
warn
,error
, orfatal
, converted to lowercase. - context: The logging context or module from which the event originated.
For example, a log event at the ERROR
level originating from the OrderProcessing
context would generate the event name rflib-error-OrderProcessing
.
It is crucial to make it a regular habit to review the Application Event Dashboard. The dashboard provides an aggregated view of issues identified by the logging framework, helping your team:
- Spot patterns in recurring issues.
- Prioritize fixes based on frequency and severity.
- Gain insights into system behavior during failures.
The Application Event Log uses Salesforce record storage to save aggregated log data. While this approach makes it convenient to query and analyze logs within Salesforce, it is important to monitor storage usage, particularly in orgs with a high volume of events. Regular housekeeping or archiving strategies may be necessary to maintain efficient storage management.
For more details on how application events work, including configuration and usage, refer to the Application Event Logging wiki page.
An error budget establishes an acceptable threshold for system failures within a defined period. This allows teams to balance feature development with system reliability. For example, if your system's error rate exceeds the agreed-upon budget, shift focus to stability improvements rather than new feature development.
When managing bug fixes:
- Prioritize fixes for issues flagged as FATAL or those recurring frequently.
- Utilize the Application Event Dashboard to identify and analyze patterns.
- Coordinate with business stakeholders to balance maintenance needs with new feature requests.
- Regularly review log aggregation data and ensure the operations team is trained to use the dashboard effectively.
- Conduct periodic reviews to optimize logging configurations, reducing noise and ensuring meaningful insights.
- Use tools like incident response platforms to automate workflows when critical events are detected. As an example, refer to the Logging to AWS CloudWatch page for guidance on consolidating RFLIB logs with external systems using advanced logging platforms.
By adopting these practices, you can maintain a robust monitoring system that ensures application reliability without sacrificing agility in delivering new features.
- Getting Started with Logging
- Logger Settings
- Log Archive
- Using Log Aggregation
- Using the Log Timer
- Masking Log Messages
- Logging in OmniStudio
- Logging to AWS CloudWatch
- RFLIB CLI Plugin