From: Logan Capaldo Date: 2006-08-05T23:31:00+09:00 Subject: Re: writing from 3 sources to 1 file 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