Ruby - logging in time-critical multithreading application -


i have log activity of application runs in many threads. best approach that? not possible threads log 1 file, because lock each other? best use separate file each thread then?

i use within method called threads @ moment:

     f=file.open(...)      f.puts "log message"      f.close 

all threads calling method. append thread number file name every thread creates own file. method called when thread calls , gives new information log. method opens file, writes information , closes again. opening , closing of file time-consuming in time-critical application? or not concerned of?


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -