Logging

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!
Post Reply
User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Logging

Post by jaha » Tuesday 13 March 2018 10:08

Hi

Im having some problems with my domoticz crashing. Here is my .sh start file.

The log file is always empty.

How can I get domoticz to start logging to the file?

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=system
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/home/system/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"

User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Re: Logging

Post by jaha » Friday 23 March 2018 15:53

Plz help :)

User avatar
waaren
Posts: 501
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Logging

Post by waaren » Friday 23 March 2018 23:57

The first couple of lines of my /etc/init.d/domoticz.sh (this logs domoticz logging to /var/log/domoticz.log on my system)

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/opt/domoticz/$NAME
DAEMON_ARGS="-daemon"
DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8084"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave , dzVents 2.4.n, Amazon echo

User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Re: Logging

Post by jaha » Monday 26 March 2018 13:39

waaren wrote:
Friday 23 March 2018 23:57
The first couple of lines of my /etc/init.d/domoticz.sh (this logs domoticz logging to /var/log/domoticz.log on my system)

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=root
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/opt/domoticz/$NAME
DAEMON_ARGS="-daemon"
DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8084"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
Thank you tried yours but still me log is empty. The file is there but empty

User avatar
jvdz
Posts: 1295
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Logging

Post by jvdz » Monday 26 March 2018 13:48

You did restart the Domoticz service?
If so, could you show what you have for those lines in the "/etc/init.d/domoticz.sh" file?

Jos

User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Re: Logging

Post by jaha » Monday 26 March 2018 14:07

jvdz wrote:
Monday 26 March 2018 13:48
You did restart the Domoticz service?
If so, could you show what you have for those lines in the "/etc/init.d/domoticz.sh" file?

Jos
Yes its restarted.

#! /bin/sh
### BEGIN INIT INFO
# Provides: domoticz
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Home Automation System
# Description: This daemon will start the Domoticz Home Automation System
### END INIT INFO

# Do NOT "set -e"

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DESC="Domoticz Home Automation System"
NAME=domoticz
USERNAME=system
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

DAEMON=/home/system/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 /var/log/domoticz.log"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

User avatar
jvdz
Posts: 1295
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Logging

Post by jvdz » Monday 26 March 2018 14:31

You are running with account system in stead of root. does that have the rights to create/update the file in that directory?

Jos

User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Re: Logging

Post by jaha » Monday 26 March 2018 14:43

jvdz wrote:
Monday 26 March 2018 14:31
You are running with account system in stead of root. does that have the rights to create/update the file in that directory?

Jos
Thank you changed to root, still the same tho :/ If I look in GUI its logs a lot but not in the file.

User avatar
jaha
Posts: 85
Joined: Thursday 26 January 2017 11:26
Target OS: Linux
Domoticz version:
Contact:

Re: Logging

Post by jaha » Monday 26 March 2018 15:12

Now it started to work! Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests