How to find domoticz log file
Moderators: leecollings, remb0
-
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
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
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
- 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
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
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
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
@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 ?
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
- 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
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:
Find the ExecStart line and append the -log and -loglevel parameters. For example:
ini
-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:
4. Apply Changes
Reload the systemd manager configuration and restart the service:
Reload daemon:
Restart service:
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 ini
Code: Select all
[Service]
ExecStart=/home/pi/domoticz/domoticz -www 8080 -log /var/log/domoticz.log -loglevel normal,status,error-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 Reload the systemd manager configuration and restart the service:
Reload daemon:
Code: Select all
sudo systemctl daemon-reloadCode: Select all
sudo systemctl restart domoticz.serviceDomoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
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
@waltervi:
Should logrotate not be adapted to the use of systemd? I'm now using in /etc/logrotate.d. This refers to (now non-existing) /etc/init.d/domoticz.sh as start for the service.
How to change?
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
}
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
I added to the system unit file:
Now this command will work in the logrotate file
At least with the latest beta's. I am running 17252
Code: Select all
ExecReload=/bin/kill -HUP $MAINPIDCode: Select all
postrotate
sudo systemctl reload domoticz.service
endscript
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
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.
This solution is not yet present in version 17252.
Logic will get you from A to B. Imagination will take you everywhere.
Who is online
Users browsing this forum: No registered users and 1 guest