Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to make a detailed log of exception with time occurred, name of the module where it occurred and its exception and separately created in different text file with date as its file name. Tried adding time on the third parameter but it does not appear on the beginning of the line. This is the starting code that I'm using:

Try
    Throw New Exception("A sample error exception")
Catch ex As Exception
     My.Application.Log.WriteException(ex, TraceEventType.Error, "Additional information or details")
End Try


Is it possible to make exception log like this with the built-in method?
sample
Posted
Comments
phil.o 10-Dec-15 3:20am    
Which built-in method are you talking about? We would also need to see the WriteException method.
Richard MacCutchan 10-Dec-15 4:52am    
Yes, it is possible. But your logging class must do all the necessary work. A simpler alternative would be to use Log4Net.
ZurdoDev 10-Dec-15 9:09am    
Not sure what your question is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900