Log level reference

The default-log-level attribute supports five logging levels that control the verbosity of log output during application preview.

Supported log levels

Log levels are hierarchical, meaning that each level includes all messages from less verbose levels. For example, the info level includes all warn and error messages.

Table 1. Log levels and their characteristics
Level Description Use case
trace Most verbose logging level. Captures all log messages including detailed execution traces, function entry and exit points, and variable states. Deep debugging of complex issues where you need to trace the complete execution flow. Use when standard debugging is insufficient to identify the root cause of a problem.
debug Debug-level logging and above. Includes detailed diagnostic information useful for troubleshooting, but excludes the most granular trace information. Development debugging and troubleshooting. Use during active development to understand application behavior and identify issues.
info Informational messages and above. Captures important application events, state changes, and normal operational messages. General development and testing. Use to monitor application behavior without excessive detail. Suitable for understanding the application flow during normal operation.
warn Warning and error messages only. Captures potentially problematic situations and actual errors, but excludes informational messages. Production monitoring and pre-production testing. Use to identify potential issues and verify error handling without generating excessive log output.
error Error messages only. Captures only critical errors and failures that prevent normal operation. Production environments with minimal logging. Use to reduce log volume while ensuring critical errors are captured. Suitable for performance testing and production simulation.

Log level hierarchy

The following hierarchy shows which messages are included at each level:

  • trace: trace + debug + info + warn + error
  • debug: debug + info + warn + error
  • info: info + warn + error
  • warn: warn + error
  • error: error only

Performance considerations

More verbose logging levels can impact application performance during preview. The trace and debug levels generate significantly more log output, which can slow down the preview server and make it harder to identify relevant information. Use these levels only when necessary for troubleshooting specific issues.