Logan Capaldo
8/5/2006 2:31:00 PM
On Aug 5, 2006, at 1:00 AM, Une bévue wrote:
> i've an app with 2 daemons, i'd like to write all the log messages to
> the same file.
>
> then i suppose i need to lock the file when one source is writing and
> wait the file is unlocked for the other ?
>
> how this could be done in ruby, or is it automagic ))
>
> --
> une bévue
>
If you are just writing on a line by line basis, OS buffering should
mitigate the need to do anything special, as long as you don't mind
have lines interleaved from different daemons.
e.g.
a whole line from daemon1
a whole line from daemon1
a whole line from daemon2
a whole line from daemon1
a whole line from daemon1