Page 1 of 1

Utility that reads the z-way-server.log

Posted: 11 Aug 2013 13:39
by hekj
I have written a utility in java that reads lines from the z-way-server.log, it's a web server.To install it, type the following commands in a terminal window:sudo apt-get install openjdk-7-jrewget http://nexahome.se/ZWaveLogDump.tartar -xf ZWaveLogDump.tar To run it, type:java ZWaveLogDumporjava ZWaveLogDump 8084To use it, open a web browser and type:http://<IP_RPi>:<PORT>/z-way-server-logThen you will get further instructions...Use this web server when you want to fetch text lines from the Z-Way log file.http://<IP_RPi>:<PORT>/z-way-server-log?limit=<NUMBEROFLINES>&from=<TIMESTAMP>&to=<TIMESTAMP>e.g.http://192.168.0.95:8084/z-way-server-log?from=2013-08-09 19:01:43.616&to=2013-08-09 19:01:43.764At least one of the parameters must be given (from, to), but you don't need to type the entire length of the timestamp (yyyy-MM-dd HH:mm:ss.SSS).Henrik | http://nexahome.se

Cool idea. But basically you

Posted: 11 Aug 2013 13:39
by PoltoS
Cool idea. But basically you can make a symlink (or even hardlink) on the log file in htdocs folder and read it from Z-Way HTTP server. Your solution is better, since can filter by date, but require java to be installed.

Biggest advantage is speed,

Posted: 11 Aug 2013 13:39
by hekj
Biggest advantage is speed, the date filter uses binary search to find the first line that matches the search criteria.

The Java source is included in the tar file.

Log size

Posted: 11 Aug 2013 13:39
by Nejc
Hey guys, nice utility ;)

But i have some problems with this log file. Does anyone know how to reduce this log file size and fast growing? (z-way-server.log)

Can you turn off logging completely or at least turn on some filtering?

Thanks in advance :)

Next version (from 1.4)

Posted: 11 Aug 2013 13:39
by PoltoS
Next version (from 1.4) contains log-level params in config.xml. Also we suggest to use logrotate to limit log size. From v1.4 these is the support of SIGHUP to re-open the log file.

What do the loglevels mean?

Posted: 11 Aug 2013 13:39
by pz1
What do the loglevels mean? Default is set to 0
How do I set logrotate in config.xml ?

log-level is from 0 (debug)

Posted: 11 Aug 2013 13:39
by PoltoS
log-level is from 0 (debug) to 6 (silent) for Z-Wave and up to 4 (Silent) in HTTP.

there is no internal log rotate mechanism, but Z-Way accepts standard mechanism used by system logrotate (SIGHUP to take over the file).

Thanx!

Posted: 11 Aug 2013 13:39
by pz1
Thanx!

Re: Utility that reads the z-way-server.log

Posted: 21 May 2014 19:12
by Mike Yeager
I updated my Z-Way installation and my log now gets rotated but the new log is empty until I do a restart. How does one use SIGHUP to fix this? I found this thread and I'm reading on SIGHUP but as of this moment I have no idea how to use it...

Re: Utility that reads the z-way-server.log

Posted: 23 May 2014 00:35
by PoltoS
We have fixed the install script to add SIGHUP on logrotate.