Create a custom log entry from automation

I like to add custom log entries from my automation, or create a seperate log for automations.
Anyone an idea how to do that?

Example:

  action:
    - service: syslog.write
      data_template:
        message: "Previous state {{trigger.from_state.state}}"
        level: warning

Thankx for your tip!