Write my own log from the rule

Two items to do:

  • modify the log4j2 logger configuration file ( /var/lib/openhab/etc/log4j2.xml )
    This is described in the mentioned thread an other example is in Logging to seperate log file OpenHab 3
  • in you DSL rule you trigger logging as you already do
logInfo("LoggerName", "LoggingText")

The entry in log4j2.xml needs to be adjusted for your rule/logging.
In your case the logger needs to be named
name="org.openhab.core.model.script.LoggerName"