Is My.Application.Log useless?

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,799
Location
Norway
Programming Experience
10+
Anyone tried the My.Application.Log in .Net 2.0? It is nicely structured and convenient to use to write logs, but I have found some major problems:

1) It doesn't flush properly. Not by setting the DefaultFileLogWriter.AutoFlush property and not by explicitly calling
DefaultFileLogWriter.Flush() after each WriteEntry. The last log entries are never flushed until application exits.

2) Accessing the log is troublesome, there are not methods to read out the log directly from My.Application.Log, and the file (DefaultFileLogWriter.FullLogFileName) is in use from application starts until it ends so you have to copy the file to a temporary file to be able to read and display logs from within the running application.

3) Since the log file is constantly in use ("by another process") it is impossible to reset the log from within the application. No methods for this in My.Application.Log either.


Have I misunderstood something about this System.Logging.Log class or is it completely useless?

http://msdn2.microsoft.com/en-US/library/microsoft.visualbasic.logging.log(VS.80).aspx
 
That could be. I am also capable of creating my own logging facility, but found the .Net inbuilt one "out of reach" and kinda funny in its own respect.
 
Back
Top