Utility that reads the z-way-server.log

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
hekj
Posts: 14
Joined: 05 Jul 2013 16:49

Utility that reads the z-way-server.log

Post by hekj » 11 Aug 2013 13:39

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

User avatar
PoltoS
Posts: 5386
Joined: 26 Jan 2011 19:36

Cool idea. But basically you

Post by PoltoS » 11 Aug 2013 13:39

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.

hekj
Posts: 14
Joined: 05 Jul 2013 16:49

Biggest advantage is speed,

Post by hekj » 11 Aug 2013 13:39

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.

Nejc
Posts: 8
Joined: 17 Aug 2013 11:51

Log size

Post by Nejc » 11 Aug 2013 13:39

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 :)

User avatar
PoltoS
Posts: 5386
Joined: 26 Jan 2011 19:36

Next version (from 1.4)

Post by PoltoS » 11 Aug 2013 13:39

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.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

What do the loglevels mean?

Post by pz1 » 11 Aug 2013 13:39

What do the loglevels mean? Default is set to 0
How do I set logrotate in config.xml ?
Since 29-12-2016 I am no longer a moderator for this forum

User avatar
PoltoS
Posts: 5386
Joined: 26 Jan 2011 19:36

log-level is from 0 (debug)

Post by PoltoS » 11 Aug 2013 13:39

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).

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Thanx!

Post by pz1 » 11 Aug 2013 13:39

Thanx!
Since 29-12-2016 I am no longer a moderator for this forum

Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

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

Post by Mike Yeager » 21 May 2014 19:12

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...

User avatar
PoltoS
Posts: 5386
Joined: 26 Jan 2011 19:36

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

Post by PoltoS » 23 May 2014 00:35

We have fixed the install script to add SIGHUP on logrotate.

Post Reply