Apex Code Settings: Log Category and Log Level

The default logging levels for Apex tests executed during deployments and for the Execute Anonymous view are defined on the Apex Code Settings page in the project properties dialog. To open the project properties dialog, right-click your top-level project folder and select Properties.

To define logging levels for Apex test execution:
  1. Select Run | Run Configurations | Apex Test.
  2. To create a test run configuration, select New launch configuration (New launch configuration icon).
  3. To customize your log levels, select the Project tab, and then select Use logging.
Run Configurations window: Project tab
You can customize these log categories.
Log Category Description
Database Includes information about database activity, including every data manipulation language (DML) statement or inline SOQL or SOSL query.
Workflow Includes information for workflow rules, flows, and processes, such as the rule name and the actions taken.
Validation Includes information about validation rules, such as the name of the rule and whether the rule evaluated true or false.
Callout Includes the request-response XML that the server is sending and receiving from an external web service. Useful when debugging issues related to using Force.com web service API calls or troubleshooting user access to external objects via an OData adapter for Salesforce Connect.
Apex Code Includes information about Apex code. Can include information such as log messages generated by DML statements, inline SOQL or SOSL queries, the start and completion of any triggers, and the start and completion of any test method.
Apex Profiling Includes cumulative profiling information, such as the limits for your namespace and the number of emails sent.
Visualforce Includes information about Visualforce events, including serialization and deserialization of the view state or the evaluation of a formula field in a Visualforce page.
System Includes information about calls to all system methods such as the System.debug method.
You can assign these log levels to your log categories.
Log Level Description
Error, Warn, Info Includes error, warning, and information messages.
Debug Includes lower-level messages, and messages generated by calls to the System.debug method.
Fine, Finer Includes log messages generated by calls to the System.debug method, every DML statement or inline SOQL or SOSL query, and the entrance and exit of every user-defined method. In addition, the end of the debug log contains overall profiling information for the portions of the request that used the most resources. These resources include SOQL and SOSL statements, DML operations, and Apex method invocations.
Finest Includes all messages generated by the Fine or Finer log levels, as well additional information on Apex scripts, including the following.
  • Variable declaration statements
  • Start-of-loop executions
  • All loop controls, such as break and continue
  • Thrown exceptions
  • Static and class initialization code
  • Any changes in the with sharing context