G
Greg
Hi all,
We want to be able to log to the event log when an error occurs in our web
parts. Currently we cannot do that under SharePoint because it throws an
exception.
Below is the code where is fails:
EventLog log = new EventLog("Application", ".", "MyThing");
log.EnableRaisingEvents = true;
On the second line it throws the following exception:
- $exception {"Cannot open log Application on machine .. Windows has not
provided an error code."} System.Exception
{System.InvalidOperationException}
The exception contains an inner exception stating "Access denied."
Running the same code under an ASP.NET 2.0 application with an anonimus user
access it works fine.
Here are some facts:
- We are using windows authendication in the WSS server
- The users accessing the sharepoint site have domain accounts
- If I access the SharePoint site with a user that is NOT administrator then
it fails.
- For Admins it works fine.
- The Event log source gets installed by our installer to avoid other
sequrity problems.
How can I avoid the exception without having to make all users admins?
Please help!!!
Thanks in advance,
Greg.
We want to be able to log to the event log when an error occurs in our web
parts. Currently we cannot do that under SharePoint because it throws an
exception.
Below is the code where is fails:
EventLog log = new EventLog("Application", ".", "MyThing");
log.EnableRaisingEvents = true;
On the second line it throws the following exception:
- $exception {"Cannot open log Application on machine .. Windows has not
provided an error code."} System.Exception
{System.InvalidOperationException}
The exception contains an inner exception stating "Access denied."
Running the same code under an ASP.NET 2.0 application with an anonimus user
access it works fine.
Here are some facts:
- We are using windows authendication in the WSS server
- The users accessing the sharepoint site have domain accounts
- If I access the SharePoint site with a user that is NOT administrator then
it fails.
- For Admins it works fine.
- The Event log source gets installed by our installer to avoid other
sequrity problems.
How can I avoid the exception without having to make all users admins?
Please help!!!
Thanks in advance,
Greg.