Where are my logs? Log files have stopped updating. DId they move?

Running OH 2.3 on Ubuntu 16.04, original install was 2.0 (i think).

For some reason my log files stopped updating back in Feb. Files I always used to reference were:

/var/log/openhab2/openhab.log
/var/log/openhab2/events.log

My Karaf console settings are:

openhab> log:list
Logger                                                      │ Level
────────────────────────────────────────────────────────────┼──────
ROOT                                                        │ WARN
com.beowulfe.hap                                            │ DEBUG
javax.jmdns                                                 │ ERROR
org.eclipse.smarthome                                       │ INFO
org.jupnp                                                   │ ERROR
org.openhab                                                 │ INFO
org.openhab.binding.xbmc                                    │ INFO
org.openhab.homekit                                         │ DEBUG
org.openhab.io.homekit                                      │ INFO
org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper │ ERROR
smarthome.event                                             │ INFO
smarthome.event.InboxUpdatedEvent                           │ ERROR
smarthome.event.ItemStateEvent                              │ ERROR
smarthome.event.ThingStatusInfoEvent                        │ ERROR

if the below is related, please can someone explain the resolution. I don’t follow what action needs taking.

user@openhab:~$ ls -l /usr/share/openhab2/userdata/etc/org.ops4j.pax.logging*
-rw-r--r-- 1 root root 2387 Feb 16 11:44 /usr/share/openhab2/userdata/etc/org.ops4j.pax.logging.cfg
user@openhab:~$ cat /usr/share/openhab2/userdata/etc/org.ops4j.pax.logging.cfg
# Root logger
log4j.rootLogger = WARN, out, osgi:*
log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer

# openHAB specific logger configuration
log4j.logger.smarthome.event = INFO, event, osgi:*
log4j.logger.smarthome.event.ItemStateEvent = ERROR
log4j.logger.smarthome.event.ThingStatusInfoEvent = ERROR
log4j.logger.smarthome.event.InboxUpdatedEvent = ERROR
log4j.additivity.smarthome.event = false

log4j.logger.org.openhab = INFO
log4j.logger.org.eclipse.smarthome = INFO
log4j.logger.org.jupnp = ERROR
log4j.logger.javax.jmdns = ERROR
log4j.logger.org.ops4j.pax.web.service.jetty.internal.JettyServerWrapper = ERROR

# CONSOLE appender not used by default
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n

# File appender - openhab.log
log4j.appender.out=org.apache.log4j.RollingFileAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j.appender.out.file=${openhab.logdir}/openhab.log
log4j.appender.out.append=true
log4j.appender.out.maxFileSize=10MB
log4j.appender.out.maxBackupIndex=10

# File appender - events.log
log4j.appender.event=org.apache.log4j.RollingFileAppender
log4j.appender.event.layout=org.apache.log4j.PatternLayout
log4j.appender.event.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-26.26c{1}] - %m%n
log4j.appender.event.file=${openhab.logdir}/events.log
log4j.appender.event.append=true
log4j.appender.event.maxFileSize=10MB
log4j.appender.event.maxBackupIndex=10

# Sift appender
log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
log4j.appender.sift.key=bundle.name
log4j.appender.sift.default=openhab
log4j.appender.sift.appender=org.apache.log4j.FileAppender
log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
log4j.appender.sift.appender.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j.appender.sift.appender.file=${openhab.logdir}/$\\{bundle.name\\}.log
log4j.appender.sift.appender.append=true
log4j.logger.com.beowulfe.hap = INFO
log4j.logger.org.openhab.binding.xbmc = INFO
log4j.logger.utterbollocks = DEBUG
log4j.logger.org.openhab.homekit = INFO
log4j.logger.org.openhab.io.homekit = INFO

Rename/delete the log-files und restart oH.

Thanks Harry,

Renamed events.log and openhab.log and restarted the service. openhab.log was recreated, but so far nothing has been written to it.

sudo mv /var/log/openhab2/openhab.log /var/log/openhab2/openhab.log.broken
sudo mv /var/log/openhab2/events.log /var/log/openhab2/events.log.broken
sudo service openhab2 restart
sudo reboot
 
user@openhab:~$ ls -lh /var/log/openhab2/{openhab,events}.log
ls: cannot access '/var/log/openhab2/events.log': No such file or directory
-rw-r--r-- 1 openhab openhab 0 Jun 22 15:14 /var/log/openhab2/openhab.log

any other thoughts? I can’t fix all the other broken stuff without logs :frowning:

Maybe this works for you as well:

1 Like

Yes ! that worked. Many thanks .

Every else is still broken, but i have a chance now…

1 Like