### Log Files

Reviewing the log files is essential when developing.
If the log files are getting to big, delete the file as sudo accordingly.
Example:
$sudo rm /var/log/openhab/openhab.log
openHAB Log Files
The openHAB log files can be found in /var/log/openhab.
openHAB Events Log
Every event is logged in /var/log/openhab/events.log.
Examples:
2016-02-20 11:29:20 - outa0 state updated to OFF
2016-02-20 11:30:00 - TF_AmbientLight state updated to Undefined
openHAB Log
The openHAB log file /var/log/openhab/openhab.log is useful to check for errors, warnings and info.
If f.e. a rules file has a syntax error, this is logged.
Examples:
2016-02-20 11:26:53.398 [ERROR] [.t.internal.TinkerforgeBinding] - COMMAND no tinkerforge device found for command for item uid: gkM subId: outa1
2016-02-20 11:29:59.343 [INFO ] [penhab.io.rest.RESTApplication] - Stopped REST API
2016-02-20 11:33:22.254 [INFO ] [.o.core.internal.CoreActivator] - openHAB runtime has been started (v1.8.1).
2016-02-20 11:34:15.024 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'io16test.items'
2016-02-20 11:34:19.117 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'weather-station.items'
2016-02-20 11:34:34.668 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'io16test.sitemap'
2016-02-20 11:34:37.349 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'weather-station.sitemap'
2016-02-20 11:34:55.513 [INFO ] [penhab.io.rest.RESTApplication] - Started REST API at /rest
2016-02-20 11:35:02.731 [INFO ] [.o.u.w.i.servlet.WebAppServlet] - Started Classic UI at /classicui/openhab.app
2016-02-20 11:35:21.873 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'weather-station.rules'
2016-02-20 11:35:25.798 [WARN ] [c.internal.ModelRepositoryImpl] - Configuration model 'weather-station.rules' is either empty or cannot be parsed correctly!
2016-02-20 11:35:26.028 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'io16test.rules'
2016-02-20 11:35:28.051 [INFO ] [.service.AbstractActiveService] - Tinkerforge Refresh Service has been started
2016-02-20 11:35:50.091 [INFO ] [org.openhab.model.script.FILE ] - 2016-02-20 11:35:48 - State OFF
openHAB Log add entry fromrules
Adding entries to the logfile is possible by executing a rule.
Example:
rule "LED A0 Switch"
when
Item outa0 changed
then
var SimpleDateFormat df = new SimpleDateFormat( "YYY-MM-dd HH:mm:ss" )
var String Timestamp = df.format ( new Date() )
if (outa0.state == ON) {
logInfo( "FILE", Timestamp + " - State " + "ON")
}
else {
logInfo( "FILE", Timestamp + " - State " + "OFF" )
}
end

Changed: , Category: TinkerForge openHAB, File: T6C267M1989.htm, ID: 1989