Log files and cans of worms

Hi,
I'm quite sure this could start a lot of arguements :p.

If i am creating a log file that is constantly added to during the
lifetime of my program, is it best to have a permanent Streamwriter
object that i write to and then flush after each comment, or to spawn a
new one each time i need to add to the log Or maybe there's some
magical medium i haven't heard of

Forget the postcards, just post your answers here instead.

James.


Answer this question

Log files and cans of worms

  • Daraius

    Try using the enterprise library logging block or log4net. They provide more functionality than you can imagine with a very light learning curve.

  • Log files and cans of worms