471,353 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,353 software developers and data experts.

Where to store custom error log

I want to write some custom error messages to a log so that I can read them
on the next run of the application and as the user to send them to me.

Where the right place to store this log file? Which directory path is the
right one - so that it's always writable regardless of the user's
permissions. I guess it's more of an application-level log than a user-level
log. Or maybe not.

Is there an up-to-date (e.g. .NET 3.5/Vista specific) description of what
the various system directory paths are for?

Jun 27 '08 #1
3 1518
On Apr 21, 6:04*am, <Debbie.Cr...@nospamforme.comwrote:
I want to write some custom error messages to a log so that I can read them
on the next run of the application and as the user to send them to me.

Where the right place to store this log file? Which directory path is the
right one - so that it's always writable regardless of the user's
permissions. I guess it's more of an application-level log than a user-level
log. Or maybe not.

Is there an up-to-date (e.g. .NET 3.5/Vista specific) description of what
the various system directory paths are for?
string sLogFolder =
Environment.GetFolderPath(Environment.SpecialFolde r.LocalApplicationData)
+ "\\" + Application.CompanyName + "\\" + Application.ProductName

is how I do it.
Jun 27 '08 #2
Create an application event at the event log and store that there. So that
next time you run the app, your app can read that first and from there it
can further go ahead.

HTH
<De**********@nospamforme.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I want to write some custom error messages to a log so that I can read them
on the next run of the application and as the user to send them to me.

Where the right place to store this log file? Which directory path is the
right one - so that it's always writable regardless of the user's
permissions. I guess it's more of an application-level log than a
user-level log. Or maybe not.

Is there an up-to-date (e.g. .NET 3.5/Vista specific) description of what
the various system directory paths are for?
Jun 27 '08 #3
On Apr 21, 6:04*am, <Debbie.Cr...@nospamforme.comwrote:
I want to write some custom error messages to a log so that I can read them
on the next run of the application and as the user to send them to me.

Where the right place to store this log file? Which directory path is the
right one - so that it's always writable regardless of the user's
permissions. I guess it's more of an application-level log than a user-level
log. Or maybe not.

Is there an up-to-date (e.g. .NET 3.5/Vista specific) description of what
the various system directory paths are for?
In our application we just write to a network folder. We write a file
per user, whenever we got an exception with some details that usually
the user don't have access or forget to tell, program name, error
message, stack, etc. The user just says the system is not working...:)
Of course this is our case...

Alcides Schulz
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Jonas Rundberg | last post: by
3 posts views Thread by Bob | last post: by
7 posts views Thread by Yongsub Eric Shin | last post: by
5 posts views Thread by Guadala Harry | last post: by
3 posts views Thread by Darren Clark | last post: by
10 posts views Thread by Brett Romero | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.