[Interest] logrotating qDebug

Francesco Lamonica alienpenguin at gmail.com
Mon Sep 30 09:03:30 CEST 2013


Hi Thiago,
i am not sure i understand your response... if the problem was a file
offest would not affect all the files and all the rotations? (there are any
processes of the same app that have their outputs redirected to different
files that are rotated)
But only some of them show this behaviour while others are rotated as i
would like.

thanks


On Fri, Sep 27, 2013 at 8:22 PM, Thiago Macieira
<thiago.macieira at intel.com>wrote:

> 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
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130930/cf2b969c/attachment.html>


More information about the Interest mailing list