G
Guest
I was wondering if anyone has simple code (or an example) (maybe in VB.Net)
that shows how to log a message to a file. This is to be a general logger,
that might log application errors and/or warnings. I've seen some stuff that
does this with the EventLog, but that seems a bit much for my needs. I'd
just like to be able to log to a file.
I'm figuring, to avoid collision in case another app is trying to log at the
same time, that I'll add some code to sleep a random number of miliseconds
and try the write again (allowing for up to 10 retries before considering it
to be unresolvable).
Unless someone has a better approach. Please help. It's appreciated.
that shows how to log a message to a file. This is to be a general logger,
that might log application errors and/or warnings. I've seen some stuff that
does this with the EventLog, but that seems a bit much for my needs. I'd
just like to be able to log to a file.
I'm figuring, to avoid collision in case another app is trying to log at the
same time, that I'll add some code to sleep a random number of miliseconds
and try the write again (allowing for up to 10 retries before considering it
to be unresolvable).
Unless someone has a better approach. Please help. It's appreciated.