Skip to content

ESP32 Log Tag Not Showing Correct Component

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 Log Tag Not Showing Correct Component. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 log tags are empty or display the wrong component name in output.

Quick Fix

Wrong

ESP_LOGI('", "No tag');  // Empty tag
I (123) : No tag
(Empty tag - hard to identify source)
static const char* TAG = "my_sensor";
ESP_LOGI(TAG, "Temperature: %.1f", 22.5);
ESP_LOGW(TAG, "Sensor read failed: %s", "timeout");
// Output with descriptive tag
I (123) my_sensor: Temperature: 22.5
W (124) my_sensor: Sensor read failed: timeout

Prevention

Define TAG constant at top of each file. Use descriptive component names. Use format specifiers in log messages. Keep tags under 16 characters. Use uppercase with underscores for consistency.

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What tag naming convention should I use?

Use uppercase with underscores matching the component: APP, WIFI, HTTP_SERVER, SENSOR_READER. Keep consistent across files.

Can I use dynamic tag strings?

Yes. Pass any string as the tag. Static constants use less RAM than dynamically allocated strings.

How do I filter logs by tag?

Use idf.py monitor --print-filter="tag:my_sensor" for ESP-IDF. In Arduino, use esp_log_level_set() to suppress other tags.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro