logging

I want to write a log method for my application. Should I open and close the logfile every time I want to write something to it? Or should I open it in the beginning, use a BufferedReader end close it when the application exits? Is it safer to open/close the file every time you write to it?

If the application terminates in a abnormal way, is the data lost if the file was still open?

Thanks,

Youngster

[429 byte] By [youngster__a] at [2007-9-28 3:13:05]
# 1
You should look at either java.util.loggin or log4j
jschella at 2007-7-7 22:46:03 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...