Page 1 of 1

Change loglevel for WebServer

Posted: Tuesday 23 February 2021 8:43
by jgaalen
Hi,

Does anyone knows how to change the loglevel of specifically the WebServer component? My logs are swamped with lines like:
2021-02-23 08:41:54.172 Status: Incoming connection from: 192.168.4.192
2021-02-23 08:41:54.174 Status: Incoming connection from: 192.168.4.192
2021-02-23 08:41:54.176 Status: Incoming connection from: 192.168.4.192
2021-02-23 08:41:54.504 Status: Incoming connection from: 192.168.4.66
2021-02-23 08:41:54.513 Status: Incoming connection from: 192.168.4.66
2021-02-23 08:41:54.522 Status: Incoming connection from: 192.168.4.66
2021-02-23 08:41:55.127 Status: Incoming connection from: 192.168.4.192
2021-02-23 08:41:55.129 Status: Incoming connection from: 192.168.4.192

But I cannot find a way to specifically reduce these logs. They have the log level log_status. Thanks

Re: Change loglevel for WebServer

Posted: Tuesday 23 February 2021 10:09
by waaren
jgaalen wrote: Tuesday 23 February 2021 8:43 Does anyone knows how to change the loglevel of specifically the WebServer component? My logs are swamped with lines like:
It's not possible without modifying the source and compile locally

Re: Change loglevel for WebServer

Posted: Tuesday 23 February 2021 10:35
by jgaalen
And how to change the loglevel to ignore 'log_status' lines?

Re: Change loglevel for WebServer

Posted: Tuesday 23 February 2021 10:44
by waaren
jgaalen wrote: Tuesday 23 February 2021 10:35 And how to change the loglevel to ignore 'log_status' lines?
You can set the loglevel in /etc/init.d/domoticz.sh

The domoticz logfile location and other settings are defined in /etc/init.d/domoticz.sh
the relevant settings are in set to the DAEMON_ARGS var.

with an editor of choice

Code: Select all

DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log" # or any other OS file
#DAEMON_ARGS="$DAEMON_ARGS -loglevel  normal,status,error, debug" # debug disabled for now
#DAEMON_ARGS="$DAEMON_ARGS -loglevel  normal,status,error" # these loglevels will make it to the logfile
DAEMON_ARGS="$DAEMON_ARGS -loglevel error" # Only errors 
#DAEMON_ARGS="$DAEMON_ARGS -debuglevel normal,hardware,received,webserver,eventsystem,python,thread_id"

Code: Select all

sudo systemctl daemon-reload
sudo service domoticz stop
sudo service domoticz start
sudo tail -f  /var/log/domoticz.log