From: Gerhard Wolf on
Hi,

in my C++ application i use LOG-Files. At the moment i have no idea how
to chop them efficiently if they exceed a size (or linecount) limit.
Surely has been many times implemented and is used on linux
(/var/logs/messages).

How can i do that efficiently?
From: Stefan Naewe on
On 4/16/2008 1:58 PM, Gerhard Wolf wrote:
> Hi,
>
> in my C++ application i use LOG-Files. At the moment i have no idea how
> to chop them efficiently if they exceed a size (or linecount) limit.
> Surely has been many times implemented and is used on linux
> (/var/logs/messages).
>
> How can i do that efficiently?

Don't reinvent the wheel. Use something like 'logrotate'.

S.
--
Stefan Naewe stefan dot naewe at atlas-elektronik dot com
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
From: Aggro on
Gerhard Wolf wrote:
> Hi,
>
> in my C++ application i use LOG-Files. At the moment i have no idea how
> to chop them efficiently if they exceed a size (or linecount) limit.
> Surely has been many times implemented and is used on linux
> (/var/logs/messages).
>
> How can i do that efficiently?

Rename the old file and create a new empty file with the old name.