in reply to efficiently dispatching loggers for daemon

make use of the system handles for in/out/err:

somecommand > stdout.log 2>stderr.log

Replies are listed 'Best First'.
Re: Re: efficiently dispatching loggers for daemon
by agh (Novice) on Mar 09, 2004 at 22:21 UTC

    Thanks for the comment, but this does not address my problem. I can't just dump output to a file. I need to feed it through a log rotator. And I need to keep STDERR and SDTOUT seperate so I can't do something like:

    exec 2>&1 daemon | rotatelogs &

    The daemon in question is Postgres' postmaster driving a pretty hefty database. I can't go restarting it every time I need to rotate a log file and it doesn't re-open log file handles on HUP.

    I'm considering re-dirrecting to named pipes, but I don't want to risk them getting full and blocking the database. Syslog sadly is not an option for political reasons.

    Any suggestions would be greatly appreciated.

      what's the difference in your stdout vs stderr? the standard method of starting postgres (using pg_ctl) already combines the outputs...

      I looked around and the only thing ppl have done to solve the problem of keeping them separate is to used named pipes. good luck!