Syslog problem

Hi everyone,
Since I updated esphome to 2025.11.5, I can’t compile because the syslog component has changed (I had 2025.5.0, so I don’t know when it changed).
My previous configuration was:
syslog:
ip_address: x.x.x.x
port: 514

But now if I leave it like this, I get this error:

src/esphome/components/syslog/syslog_component.cpp: In member function ‘virtual void esphome::syslog::SyslogComponent::setup()’:src/esphome/components/syslog/syslog_component.cpp:36:52: error: cannot convert ‘esphome::syslog::SyslogComponent::setup()::<lambda(int, const char*, const char*)>’ to ‘std::function<void(unsigned char, const char*, const char*, unsigned int)>&&’ 36 | logger::global_logger->add_on_log_callback([this](int level, const char tag, const char message) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | esphome::syslog::SyslogComponent::setup()::<lambda(int, const char, const char)> 37 | if(!this->enable_logger) return; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | if(this->strip_colors) { //Strips the “033[0;xxx” at the beginning and the “#033[0m” at the end of log messages | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 39 | std::string org_msg(message); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 40 | this->log(level, tag, org_msg.substr(7, org_msg.size() -7 -4)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41 | } else { | ~~~~~~~~ 42 | this->log(level, tag, message); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 43 | } | ~ 44 | }); | ~ In file included from src/esphome/components/syslog/syslog_component.cpp:7:src/esphome/components/logger/logger.h:161:95: note: initializing argument 1 of ‘void esphome::logger::Logger::add_on_log_callback(std::function<void(unsigned char, const char*, const char*, unsigned int)>&&)’ 161 | void add_on_log_callback(std::function<void(uint8_t, const char , const char , size_t)> &&callback); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~Compiling .pioenvs/2-gestione-pt/src/esphome/components/text_sensor/text_sensor.cpp.o* [.pioenvs/2-gestione-pt/src/esphome/components/syslog/syslog_component.cpp.o] Error 1========================= [FAILED] Took 540.25 seconds =========================

Looking at the new component on the website, I should configure it like this:

syslog:

udp:
addresses: x.x.x.x(ip_server)

time:

  • platform: homeassistant
    id: homeassistant_time

But I get the exact same error.
Could someone tell me how to configure sending logs to a syslog server now?

Thank you very much.

This is a complete working example:

esphome:
  name: syslogger

esp32:
  variant: esp32
  framework:
    type: esp-idf

wifi: !include wifi.yaml

logger:

udp:
  addresses: 192.168.254.1

time:
  platform: sntp

syslog:

interval:
  - interval: 5s
    then:
      logger.log: "Logging"

If that doesn’t work for you, post your complete yaml, plus compile logs, properly formatted. Your original post is unreadable since you didn’t wrap the log and yaml between triple backticks (```).

hello, thanks for reply, i try your configuration:

esphome:
  name: ${name}
  friendly_name: ${name}


esp32:
  board: esp32-s3-devkitc-1

  framework:
    type: arduino


###### WIFI
wifi:
  networks:
  - ssid: !secret wifi_iot_ssd
    password: !secret wifi_iot_password
    hidden: true
  - ssid: !secret wifi_casa_ssd
    password: !secret wifi_casa_password
  reboot_timeout: 300s
  power_save_mode: none
  output_power: 17   
  min_auth_mode: wpa2

    
  ap:
    ssid: ${name}
    password: !secret esphome_password

captive_portal:

logger:

udp:
  addresses: 192.168.0.3

time:
  platform: sntp

syslog:

select:
  - platform: logger
    name: "Logger select"

api:
  reboot_timeout: 15min
  encryption:
    key: !secret esphome_key

ota:
  - platform: esphome
    password: !secret esphome_password

interval:
  - interval: 5s
    then:
      logger.log: "Logging" 

but it doesn’t work, here there is the error when i try to compile:

Compiling .pioenvs/2-gestione-pt/src/esphome/components/text_sensor/filter.cpp.o
src/esphome/components/syslog/syslog_component.cpp: In member function 'virtual void esphome::syslog::SyslogComponent::setup()':
src/esphome/components/syslog/syslog_component.cpp:36:52: error: cannot convert 'esphome::syslog::SyslogComponent::setup()::<lambda(int, const char*, const char*)>' to 'std::function<void(unsigned char, const char*, const char*, unsigned int)>&&'
   36 |         logger::global_logger->add_on_log_callback([this](int level, const char *tag, const char *message) {
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    esphome::syslog::SyslogComponent::setup()::<lambda(int, const char*, const char*)>
   37 |             if(!this->enable_logger) return;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
   38 |             if(this->strip_colors) { //Strips the "033[0;xxx" at the beginning and the "#033[0m" at the end of log messages
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 |                 std::string org_msg(message);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
   40 |                 this->log(level, tag, org_msg.substr(7, org_msg.size() -7 -4));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   41 |             } else {
      |             ~~~~~~~~                                
   42 |                 this->log(level, tag, message);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
   43 |             }
      |             ~                                       
   44 |         });
      |         ~                                           
In file included from src/esphome/components/syslog/syslog_component.cpp:7:
src/esphome/components/logger/logger.h:161:95: note:   initializing argument 1 of 'void esphome::logger::Logger::add_on_log_callback(std::function<void(unsigned char, const char*, const char*, unsigned int)>&&)'
  161 |   void add_on_log_callback(std::function<void(uint8_t, const char *, const char *, size_t)> &&callback);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
*** [.pioenvs/2-gestione-pt/src/esphome/components/syslog/syslog_component.cpp.o] Error 1
========================= [FAILED] Took 555.64 seconds =========================

Your code compiles fine for me - what version of ESPHome are you using? This is reported in the first line of the compile log.

You may also want to try cleaning the build.

I’d also suggest using esp-idf instead of Arduino, though that’s not the problem.

i have the addon with version: 2025.11.5.

Does anyone else use syslog and can you tell me what configuration they use with the latest version of esphome? Thanks

what version of esphome do you have?