How to find domoticz log file

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

Post Reply
meal
Posts: 117
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

How to find domoticz log file

Post by meal »

Hello,

1 - Context
Domoticz V2025.2 (build 17277) running on bookworm
Build Hash fac6d8f
Compile Date 2026-02-26 06:42:05
dzVents Version 3.1.11
Python Version 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0]

2 - How to find domoticz log file

I switched from the deprecated mean to create domoticz service using the /etc/init.d/domoticz.sh file to the preferred one in /etc/systemd/system/domoticz.service.

Previously i recorded domoticz messages in "/var/log/domoticz.log" by setting in domoticz.sh file the line:
DAEMON_ARGS="$DAEMON_ARGS -log /var/log/domoticz.log"

Now when using /etc/systemd/system/domoticz.service I see the domoticz messages in domoticz UI but I am not able to find in which file they are stored. I also would like to define the file name supporting these messages.

I would be grateful if someone could help me or give me a hint.

BR
meal
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: How to find domoticz log file

Post by waltervl »

It should be defined in the EnvironmentFile (eg /home/pi/domoticz.env)
See https://wiki.domoticz.com/Linux#Option_ ... Preferred)

the location of the environment file is set in the systemd configuration file eg
/etc/systemd/system/domoticz.service
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
meal
Posts: 117
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

Re: How to find domoticz log file

Post by meal »

@waltervl

Many thanks for the information.
To be more precise if I want to store the domoticz messages in /tmp/domoticz.log what do I have to set in /home/pi/domoticz.env file ?
meal
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: How to find domoticz log file

Post by waltervl »

Seems I was wrong according AI:

To set the Domoticz log file using a systemd service configuration, you must modify the ExecStart directive within the service unit file to include the -log command-line parameter.
1. Locate the Service File
The Domoticz systemd service file is typically located at:
/etc/systemd/system/domoticz.service

2. Configure the Log File Path
Edit the file using a text editor like nano:

Code: Select all

sudo nano /etc/systemd/system/domoticz.service 
Find the ExecStart line and append the -log and -loglevel parameters. For example:
ini

Code: Select all

[Service]
ExecStart=/home/pi/domoticz/domoticz -www 8080 -log /var/log/domoticz.log -loglevel normal,status,error
-log <path>: Specifies the full path to the log file.
-loglevel <levels>: Sets the verbosity (e.g., normal,status,error,debug).

3. Set Permissions (not sure this is needed)
Ensure the directory where the log will be stored exists and that the user running Domoticz (often pi or domoticz) has write permissions to it:

Code: Select all

sudo touch /var/log/domoticz.log
sudo chown pi:pi /var/log/domoticz.log 
4. Apply Changes
Reload the systemd manager configuration and restart the service:
Reload daemon:

Code: Select all

sudo systemctl daemon-reload
Restart service:

Code: Select all

sudo systemctl restart domoticz.service
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
meal
Posts: 117
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.2
Location: France
Contact:

Re: How to find domoticz log file

Post by meal »

Many thanks
meal
Doler
Posts: 166
Joined: Friday 31 July 2015 21:02
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Sint-Oedenrode, Netherlands
Contact:

Re: How to find domoticz log file

Post by Doler »

@waltervi:
Should logrotate not be adapted to the use of systemd? I'm now using

Code: Select all

/var/log/domoticz.log {
	missingok
	daily
	rotate 7
	compress
	delaycompress
	notifempty
	postrotate
		if [ -x /usr/sbin/invoke-rc.d ]; then \
			invoke-rc.d domoticz.sh reload > /dev/null; \
		else \
			/etc/init.d/domoticz.sh reload > /dev/null; \
		fi
	endscript
}
in /etc/logrotate.d. This refers to (now non-existing) /etc/init.d/domoticz.sh as start for the service.
How to change?
Mark: Domoticz latest Beta on Virtual machine (Proxmox) running Debian Trixie - Z-Stick 7 - RFXCom - P1 - SolarEdge - Dahua - Philips Hue - Docker - Zigbee2mqtt (latest, docker) via python plugin - Zwave-js-ui (latest, docker) - dzVents - Nodered
Kedi
Posts: 597
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: How to find domoticz log file

Post by Kedi »

I added to the system unit file:

Code: Select all

ExecReload=/bin/kill -HUP $MAINPID
Now this command will work in the logrotate file

Code: Select all

        postrotate
                sudo systemctl reload domoticz.service
        endscript
At least with the latest beta's. I am running 17252
Logic will get you from A to B. Imagination will take you everywhere.
Kedi
Posts: 597
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: How to find domoticz log file

Post by Kedi »

I was wrong with the "kill -HUP" solution, it stops domoticz, my monit started then domoticz again.
This solution is not yet present in version 17252.
Logic will get you from A to B. Imagination will take you everywhere.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest