LUA print statements in Domoticz log not working

Moderator: leecollings

Post Reply
joremkes
Posts: 2
Joined: Saturday 10 February 2018 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10224
Contact:

LUA print statements in Domoticz log not working

Post by joremkes »

Hi All,

I'm doing some LUA script debugging and I like to see the output of the print statements in de LUA script somewhere in the log. I've been playing with the DAEMON_ARGS setting in the domoticz.sh but so far no result playing around with the loglevel and debuglevel. This is what I currently have:

Code: Select all

DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
DAEMON_ARGS="$DAEMON_ARGS -loglevel normal,status,error,debug"
DAEMON_ARGS="$DAEMON_ARGS -debuglevel eventsystem"
Any idea on how to get this working?

Thanks, Joep
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: LUA print statements in Domoticz log not working

Post by waaren »

joremkes wrote: Wednesday 28 November 2018 1:41 I'm doing some LUA script debugging and I like to see the output of the print statements in de LUA script somewhere in the log.
Any idea on how to get this working?
Change line

Code: Select all

#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt" 
to

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
and restart domoticz. You will see the loglines coming in the file /tmp/domoticz.txt
For normal use the lines

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -loglevel normal,status,error,debug"
DAEMON_ARGS="$DAEMON_ARGS -debuglevel eventsystem"
can be changed to

Code: Select all

#DAEMON_ARGS="$DAEMON_ARGS -loglevel normal,status,error,debug"
#DAEMON_ARGS="$DAEMON_ARGS -debuglevel eventsystem"
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
joremkes
Posts: 2
Joined: Saturday 10 February 2018 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10224
Contact:

Re: LUA print statements in Domoticz log not working

Post by joremkes »

Ok, I got it working and I also realized my mistake.... :shock: :shock: :shock: :shock:

I was actually changing the domoticz.sh in my ~/domoticz folder. (I run Domoticz on a Raspberry Pi). After making the suggested changes still no logging and also there was no tmp/domoticz.txt file. My logs are in the tmp/log/domoticz.log file. Then I realized that ages ago I made a ramdisk for the domoticz db file and the log. I looked up the article and actually found out I had to use the /etc/init.d/domoticz.sh to make the changes to :oops: . After making the changes here (removed -loglevel 1) I have LUA logging in my logs again including the output of the print commands.

Thanks for helping out!

Joep
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest