Logging into separate File and see it in log:tail

  • openHAB version: 2.5.0 M1

I managed to log “logInfo” from rules into a separate File, but since that logging is active I don’t see the info by using log:tail in the console.
How do I send it into the File and see it in log:tail for live debugging?

Thank you

This is the code I used in org.ops4j.pax.logging.cfg:

# Info Logger
log4j2.logger.Info.name = org.eclipse.smarthome.model.script
log4j2.logger.Info.level = INFO
log4j2.logger.Info.additivity = false
log4j2.logger.Info.appenderRefs = Info
log4j2.logger.Info.appenderRef.Info.ref = Info

# Info Appender
log4j2.appender.Info.name = Info
log4j2.appender.Info.type = RollingRandomAccessFile
log4j2.appender.Info.fileName = /var/log/openhab2/Info.log
log4j2.appender.Info.filePattern = /var/log/openhab2/Info.log.%i
log4j2.appender.Info.immediateFlush = true
log4j2.appender.Info.append = true
log4j2.appender.Info.layout.type = PatternLayout
log4j2.appender.Info.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.Info.policies.type = Policies
log4j2.appender.Info.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.Info.policies.size.size = 10MB
log4j2.appender.Info.strategy.type = DefaultRolloverStrategy
log4j2.appender.Info.strategy.max = 10

Try reading thru this Topic:

If you still have issues let me know and I’ll try to help. Gotta log out for now, still have Christmas stuff to do.