On sexta-feira, 27 de setembro de 2013 09:14:08, Francesco Lamonica wrote:
> Hi all,
> i am using logrotate on a file that is populated by qDebug() statements of
> my app (that does not get restarted).
> Sometimes ( i have been unable to find the behaviour's causes so far ) the
> logorotating does not happen and what i get is what seems to be a binary
> file.
> Any ideas what might be happening?

You forgot the restarting of your application.

The file looks binary because of that "copytruncate" at the end. When logrotate 
runs, it will truncate the output file to zero size. But since you didn't 
restart the application, it will continue writing from the exact byte offset as 
it had been before. That means the beginning of the file is composed of NUL 
bytes. Hence, binary.

> 
> the logrotate options used are:
> /opt/nrsc/consolelogs/*.txt {
>   rotate 2
>   daily
>   size 2M
>   compress
>   missingok
>   notifempty
>   copytruncate
> }

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to