Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating an Winforms Apps using C#. What i am trying to implement is the Log file creation for error's and exception occurred in the App.

This app is going to be used by users with limited access rights on the windows system.
So I want to make sure that the log file get created in a location where Users cannot write to it or delete it and I do not want get an Unauthorized Access Exception or to say error while creating the log file.

In short which place in the Windows system is the best suitable place to create a log file for each user who uses this app of mine.

Please advise.

Thanks in advance.
Posted

1 solution

Simple. Use the windows event log

here's an article on how to use it

How To Create a Windows Event Log and Write your Custom Message as well[^]

Does that suit your needs?
 
Share this answer
 
Comments
CHill60 14-May-15 5:10am    
+5
Andy Lanng 14-May-15 5:11am    
Thanks ^_^
Christopher Fernandes 15-May-15 2:23am    
How to solve this error?

The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.
Andy Lanng 15-May-15 4:04am    
Post it as a new question.

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