Logging own log entries into different own log files

Great. It works! Thanks, you have helped me a lot.

There is one more point, I would like to achieve
When I choose

log4j2.logger.Sonos.name = org.eclipse.smarthome.model.script.Sonos,

it works for my own rules loginfo entries and when I choose

log4j2.logger.Sonos.name = org.eclipse.smarthome.binding.sonos,

it works for the binding log entries.

But not together. That means, with the following code, I only get log entries coming from the binding, but those coming from my rules are missing:

# MyLogger - Sonos (Rules)
log4j2.logger.Sonos.name = org.eclipse.smarthome.model.script.Sonos
log4j2.logger.Sonos.level = INFO
log4j2.logger.Sonos.additivity = false
log4j2.logger.Sonos.appenderRefs = Sonos
log4j2.logger.Sonos.appenderRef.Sonos.ref = SONOS

# MyLogger - Sonos (Binding)
log4j2.logger.Sonos.name = org.eclipse.smarthome.binding.sonos
log4j2.logger.Sonos.level = INFO
log4j2.logger.Sonos.additivity = false
log4j2.logger.Sonos.appenderRefs = Sonos
log4j2.logger.Sonos.appenderRef.Sonos.ref = SONOS

So my question is: Is it also possible to have this both running and logging into the same file named Sonos.log?
That would be perfect. Thanks again!

1 Like