System_log.write not work

Hi All,

I was trying to add this action in one of my automations. But i dont see this line in all possible logs back.

service: system_log.write
data:
  level: info
  message: testing

Also tried this also (hoping it will log into the home-assistant.log) but noting.

service: system_log.write
data:
  level: info
  message: test
  logger: homeassistant

What do i wrong?

Make sure you specify a level equal to or greater than your logging level setting.

I initially set this to info and got nothing. Then remembered my logging level is set to warning.

service: system_log.write
data:
  level: warning
  message: "### Hello poudenes ### This is a test"

Thanks this worked. I had all my levels on error :slight_smile:

I my case, I wanted to trigger info logs but the default level is warning so Iset this in the configuration

logger:
  logs:
    homeassistant.components.system_log.external: info

Example of service call:

service: system_log.write
data:
  message: "[CUSTOM] Test systel log write service"
  logger: homeassistant.components.system_log.external
  level: info

… and the result in log:

homeassistant  | 2023-12-11 17:52:11.533 INFO (MainThread) [homeassistant.components.system_log.external] [CUSTOM] Test systel log write service