[Cialug] Command output logging

Kenneth Younger kyounger at gmail.com
Sun Nov 24 15:12:30 CST 2013


Ah copytruncate would be the proper approach with logrotate. And after
looking at multilog, I might have to give that a try.

Thanks!


On Thu, Nov 21, 2013 at 5:01 PM, Andrew Denner <linux-list at upeke.com> wrote:

> I believe that you need to run logrotate more frequently with a conf file
> that would look like
>
> /tmp/filename.log {
>         size 1k
>          copytruncate
> }
>
> where size is the size you want it to rotate at and copytruncate will
> copy the logfile off and then truncate the original in case the
> process that is writing to the log still has the file handle open.
>
> I haven't actually tried this but it appears that it should do what
> you want. (See http://www.thegeekstuff.com/2010/07/logrotate-examples/)
>
>
>
> On Thu, Nov 21, 2013 at 4:37 PM, Kenneth Younger <kyounger at gmail.com>
> wrote:
>
> > I have a somewhat custom daemon that allows me to specify in its config
> > another command to redirect all the output to (for logging purposes). I
> see
> > this as useful, since I'm generating quite a bit of log data each day,
> but
> > don't really want to stop the program just to cut the log file and switch
> > it over to a new one.
> >
> > I know of logrotate for log rotation, but is there a well known program
> > that handles logging of arbitrary output data? (file naming (file.log.2,
> > file.log.3, etc.), redirecting to new file every 100MB, etc.) Maybe
> > logrotate can do this and I don't even know it...
> >
> > Thanks,
> > -Kenny
> > _______________________________________________
> > Cialug mailing list
> > Cialug at cialug.org
> > http://cialug.org/mailman/listinfo/cialug
> >
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug
>
> --
> Kenneth Younger III
> Founder, Sheer Focus Inc.
> e: kenny at sheerfocus.com
> p: (515) 367-0001
> t: @kenny <http://twitter.com/kenny>
> <http://cialug.org/mailman/listinfo/cialug>
>


More information about the Cialug mailing list