Debug logs in Salesforce are invaluable tools for developers and administrators to monitor and troubleshoot application behavior. They capture detailed information about events and operations, such as database queries, workflow rules, validation processes, Apex code execution, and system calls. By configuring trace flags and setting appropriate log levels for specific categories, users can control the granularity of logged data. Whether using the Developer Console or monitoring specific activities, debug logs provide insights into system performance and help identify issues, making them essential for effective application management.
Features of debug logs
- Debug logs track events in your Salesforce org, generated by user-based trace flags, Apex tests, and code or API requests with debugging parameters.
- They record database operations, system processes, and errors during transactions or unit tests. They include information about database changes, HTTP callouts, Apex errors, and automated workflow processes such as Workflow rules, Assignment rules, Approval processes, Validation rules.
- Each log must be under 20 MB. Logs larger than this are truncated, retaining the most recent entries. System debug logs are kept for 24 hours, and monitoring logs for seven days. Generating over 1,000 MB of logs in 15 minutes disables trace flags.
Debug level
A debug level defines a set of log levels for different debug log categories, such as Database, Workflow, and Validation. It determines the granularity of information captured for each category. Additionally, a trace flag configures logging parameters by including a debug level, a start time, an end time, and a log type. Here are the log types:
Log Types:
- DEVELOPER_LOG: Automatically set by the Developer Console to log activities during your session.
- USER_DEBUG: Logs activities for a specific user.
- CLASS_TRACING: Overrides logging levels for Apex classes and triggers but does not generate logs on its own.
Log Category
- The type of information to be logged, such as details from Apex code, workflow rules, or database operations.
Log Level
- Determines the amount of information captured. Higher levels (e.g., DEBUG or TRACE) provide more detailed information, while lower levels (e.g., WARN or ERROR) focus on critical events.
Event Type
- Combines the log category and log level to define which events are logged. For each event, additional details such as the line and character number where the event started, associated fields, and event duration may also be captured.
Debug Log Categories
- Database
- Logs database activities, including DML statements and inline SOQL/SOSL queries.
- Workflow
- Tracks workflow rules, flows, processes, rule names, and actions taken.
- NBA (Next Best Action)
- Details Einstein Next Best Action activities and strategy execution.
- Validation
- Captures validation rule evaluations, including rule names and results (true/false).
- Callout
- Logs request-response XML for external web service interactions.
- Apex Code
- Includes Apex-specific logs such as DML, SOQL/SOSL, triggers, and test methods.
- Apex Profiling
- Provides cumulative profiling details like namespace limits and email counts.
- Visualforce
- Tracks Visualforce events, including view state serialization and formula evaluations.
- System
- Captures calls to system methods, like System.debug.
To know more, click Debug Logs
Take Five Consulting is a technology company, based in Virginia U.S., that specializes in the Mortgage Banking vertical especially LOS implementation and application development. Take Five Consulting creates and implement mortgage technology and software specifically for Mortgage Industry.


