Linux redirect kodi logging (kodi.log) to systemd-journald
#1
Hello Everybody,

Is there any way to redirect or forward kodi logging (~/.kodi/temp/kodi.log) to systemd-journald?

I've already tried systemd-cat, but it only cats the messages from stdout and stderr.

Problem in more detail is that kodi only keeps the log data of the last two sessions (kodi.log & kodi.old.log). But my setup powers off and on automatically to save energy. And there is an error with freeze at playback. It often occurs when kodi is used by my family. Currently there is no chance to get any information from the log because it gets overwritten too soon. And there is no method to reproduce the error.

A persistent kodi logging would be very helpful to identify any repeating error. I did not expect to find such fiew information about this topic in the Internet.

I hope there is someone who is able to help.

Thanks in advance :-)
Reply
#2
I'd turn logging off and turn it on only if there is a problem which needs to be addressed. That said, I do not remember any issues with my Kodi boxes for years.
Reply
#3
(2020-05-01, 16:30)Segfault Wrote: I'd turn logging off and turn it on only if there is a problem which needs to be addressed. That said, I do not remember any issues with my Kodi boxes for years.

In my case I can not reproduce the problem or predict when it will occur next time. So I have to turn on logging to get more information about the root cause. But even with turned on logginh the session log file will be gone for ever after two restarts of kodi.
Reply
#4
Not the answer to your question but what about a cronjob or systemd timer that copies the log file on a regular interval?

Code:
#!/bin/bash
KODIHOME=/var/lib/kodi
USERHOME=/home/myuser
cp "$KODIHOME"/.kodi/temp/kodi.log "$USERHOME/kodi.$(date +%Y%m%d_%H%M%S).log"
Need help programming a Streamzap remote?
Reply
#5
(2020-05-01, 17:58)graysky Wrote: Not the answer to your question but what about a cronjob or systemd timer that copies the log file on a regular interval?
Code:
#!/bin/bash
KODIHOME=/var/lib/kodi
USERHOME=/home/myuser
cp "$KODIHOME"/.kodi/temp/kodi.log "$USERHOME/kodi.$(date +%Y%m%d_%H%M%S).log"

Thanks for the idea. It pointed into the right direction. I am already using a systemd unit config file for kodi. I've added the following line to the service section.

Code:
ExecStop=/use/bin/logger -f /var/lib/kodi/.kodi/temp/kodi.log

After rebooting the system every restart of the kodi service makes the whole kodi.log file to be logged at once to syslog/journald.
Reply

Logout Mark Read Team Forum Stats Members Help
redirect kodi logging (kodi.log) to systemd-journald0