Page 1 of 1

Tips: Clean up serviio.log to the size of zero KiB

PostPosted: Thu Oct 10, 2019 1:45 am
by colemanlee
Hi,
My D:\Program Files\Serviio\log\serviio.log file size is 4.5MiB, I want to clean up this file. I do these steps:
  1. stop Serviio server in Serviio Console;
  2. clean up the content of serviio.log and save it;
  3. restart Serviio server in Serviio Console;
  4. then the serviio.log file size become 4.5Mib again, the serviio.log file content is full of "NUL" in Notepad2.exe text editor like this(which displayed in Notepad2.exe text editor)
  Code:
NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL
NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL
NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL
NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL
NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL NUL

Then i want to delete the serviio.log directly, but it shows:
  Code:
 serviio.log is used in ServiioServices.exe

I use stop/restart Serviio Services instead of Serviio Server and do the four steps above, successful.
It was a problem for me at first, then I found the solution, share it with all friends.

Re: Tips: Clean up serviio.log to the size of zero KiB

PostPosted: Thu Oct 10, 2019 1:11 pm
by atc98092
There's no problem with simply deleting the log file and letting Serviio create a new one. But as you mention the only way you can do that is by stopping the Serviio service, as it keeps the file open as long as it's running.

Re: Tips: Clean up serviio.log to the size of zero KiB

PostPosted: Sat Oct 12, 2019 10:47 am
by DenyAll
Maybe I'm mssing something, but I can simply open the log file in Notepad++, delete all the content and save it again - all while Serviio is running.

Sometimes you may have to try the save more than once if Serviio is also accessing the file at the same time, but this works for me. You end up with a zero byte file (for a liitle while at least, until Serviio writes something)... dont know why you're getting nulls???

Re: Tips: Clean up serviio.log to the size of zero KiB

PostPosted: Sat Oct 12, 2019 3:45 pm
by atc98092
I hadn't tried that in quite a while, but you're right. I don't know if it was a change to Serviio, or to Windows, but you can delete everything within the log and save the empty file without stopping the service. I know that didn't work in the past, but it's been a long time since I tried it. But you can't just delete the file while the service is running.

But I did notice that it only worked with Notepad++. Using the regular Windows Notepad I got the unable to save message. Maybe it's just something magical about Notepad++. :lol:

Re: Tips: Clean up serviio.log to the size of zero KiB

PostPosted: Mon Oct 14, 2019 3:43 pm
by colemanlee
atc98092 wrote:I hadn't tried that in quite a while, but you're right. I don't know if it was a change to Serviio, or to Windows, but you can delete everything within the log and save the empty file without stopping the service. I know that didn't work in the past, but it's been a long time since I tried it. But you can't just delete the file while the service is running.

But I did notice that it only worked with Notepad++. Using the regular Windows Notepad I got the unable to save message. Maybe it's just something magical about Notepad++. :lol:

Hi,
I tried again today, I found I can delete everything within the log and save the empty file without stopping the service. I use Notepad2.