TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
logger: component controls all debug output from an ESPHome device. By default it emits messages at DEBUG severity or higher over the device’s primary serial port, and also forwards logs to any connected native API client (such as Home Assistant or the ESPHome CLI). You can tune verbosity globally or per component tag, redirect logging to different hardware UARTs, and trigger automations when specific log messages are emitted. Getting the log level right is important: overly verbose settings slow down the device, while too-restrictive settings make debugging difficult.
Minimal Example
Configuration Variables
The global log level. Messages below this severity are stripped from the compiled firmware at build time and cannot be enabled at runtime. Defaults to
DEBUG.Options (ascending severity): VERY_VERBOSE, VERBOSE, DEBUG, INFO, WARN, ERROR, NONEThe runtime log level applied at boot. Can be more restrictive than
level (e.g. compile with VERBOSE but start at ERROR). Defaults to the value of level.Serial UART baud rate. Defaults to
115200. Set to 0 to completely disable UART logging (logs will still appear via the native API/MQTT if configured).Which hardware UART (or USB peripheral) to use for serial output. Defaults vary by chip — see the table below. Options include
UART0, UART1, UART2, UART0_SWAP (ESP8266), USB_CDC, USB_SERIAL_JTAG.Per-component or per-tag log level overrides. The tag key is the component’s internal tag (e.g.
mqtt.component, wifi). You cannot set a tag to a more verbose level than the global level (those messages were compiled out), but you can suppress tags to a higher severity.Enable runtime per-tag level changes. Auto-enabled when
logs is configured or logger.set_level is used with a tag. Manually set to true if calling set_log_level() from a lambda. Defaults to false (auto-enabled as needed).Serial transmit buffer size in bytes. Reduce if RAM is tight. Defaults to
512.ESP32, LibreTiny, nRF52 only. Ring buffer for thread-safe logging from non-main tasks. Set to
0 to disable. Defaults to 768.ESP8266 only. Keep log format strings in flash via
PROGMEM to save RAM. Defaults to true. Only change if you have a specific reason to keep format strings in RAM.After opening the serial port, drive DTR and RTS low to reset the chip into application mode. Ensures boot log messages are captured when using hardware reset lines. Defaults to
false.Triggered when a log message is emitted. Variables available:
message (const char*), level (int), tag (const char*). Note: you cannot use logger.log or ESP_LOGx macros inside this automation.Log Levels Reference
| Level | Color | Description |
|---|---|---|
NONE | — | No output at all |
ERROR | Red | Fatal issues preventing correct operation |
WARN | Yellow | Recoverable issues (invalid sensor readings, etc.) |
INFO | Green | Startup info and key state changes |
DEBUG | Cyan | General status, default for production use |
VERBOSE | Gray | Frequent state updates and sensor values |
VERY_VERBOSE | White | Raw bus traffic (I²C, SPI, UART bytes) |
Default UART Hardware Interfaces
| Variant | Default Interface |
|---|---|
| ESP8266 | UART0 |
| ESP32 | UART0 |
| ESP32-C3/C5/C6/C61/P4/S3 | USB_SERIAL_JTAG |
| ESP32-S2 | USB_CDC |
| RP2040 | USB_CDC |
| nRF52 | USB_CDC |
Advanced Example
logger.log Action
Print a formatted message from an automation:
logger.set_level Action
Change verbosity at runtime without reflashing:
Forwarding Errors to MQTT
As of ESPHome 2026.4.0, sensor state change messages were moved from
DEBUG to VERBOSE. If you’re running an older version, consider using INFO in production to avoid excessive serial traffic. On modern versions, DEBUG is appropriate for production use.