Cannot open log Application on machine



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.


.



Relevant Pages

  • Re: Opening Files from Sharepoint
    ... I had a user post with the same error and I sent him here: ... Do you have SharePoint Designer installed? ... unknown software exception occurred in the application at ... The event log lists a DRWatson 4097 error event with the description "The ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Opening Files from Sharepoint
    ... I don't have multiple versions of Office installed but I do have Sharepoint ... unknown software exception occurred in the application at ... The event log lists a DRWatson 4097 error event with the description "The ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Event Log Trust Level?
    ... What I do in this case is install the event log as part of an installer ... package and then just use write to the event log from the app. ... > but it comes back with this exception: ... > source, String logName, String machineName, Boolean ...
    (microsoft.public.dotnet.security)
  • Re: RPC over HTTPS fails following install of SharePoint Services
    ... Did you find any solution to keep SharePoint ... Service 3.0 on the same server and have it working? ... An unhandled exception has occurred. ... Thread account name: NT AUTHORITY\NETWORK SERVICE ...
    (microsoft.public.exchange.admin)
  • Re: Write to IIS/Event Log File ?
    ... >with an exception that might arise, ... >either in the web service, ... >Writting to the event log threw me Security Exceptions, ... NET Framework Class Library: ApplicationActivationAttribute ...
    (microsoft.public.dotnet.general)