Write to IIS/Event Log File ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Angelos Karantzalis (akarantzalis_at_yahoo.com)
Date: 11/12/04


Date: Fri, 12 Nov 2004 13:14:31 +0200

Hi y'all,

   recently I've come across a situation where a web service needs to deal
with an exception that might arise, originating from a COM+ component. It
then returns an int value (please don't ask me why) indicating that there
was something wrong with the requested operation.

Assuming that I don't really know all the posible exceptions that might
arise from the COM+ layer, and therefore I can't accurately return an int
identifying the exception, I need a way to log the actual exception trace,
either in the web service, or in the COM+ layer.

Writting to the event log threw me Security Exceptions, because ASPNET
doesn't have write access to the event log. Since the COM+ level runs under
the same identity apparently, I can't do it there either ..

So, question: how can I log either into the IIS Log, or the Event log from a
web service ?

Cheers,
Angel
O:]



Relevant Pages

  • 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: 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)
  • Re: Cannot open log for source {0}. You may not have write access. (Access right wanish after a whil
    ... Are the event log ACLs being changed from their initial states? ... could it be that the user context is changing? ... WindowsIdentity.GetCurrent return when the exception is thrown? ... > Our server is Win 2003 with AD and it's domain controller of it's own ...
    (microsoft.public.dotnet.security)
  • Re: Help! Error: aspnet_wp.exe (PID: xxxx) stopped unexpectedly
    ... there was no entry in event log related to recycling. ... The error was due an exception generated by the HashTable.Addmethod(in my ... The worker process was indeed bringing up the debugger selection panel(with ... Have you found any recycle record in eventlog?... ...
    (microsoft.public.dotnet.framework.aspnet)
  • Exception manegement application block cant write to Windows server 2003
    ... Impersonation and Event log" question here and decided to ask my question ... We registered the Exception Management Application Block ... System.Diagnostics.EventLog.WriteEntry(String source, String message, ... EventLogEntryType type, Int32 eventID, Int16 category, ByterawData) +68 ...
    (microsoft.public.dotnet.framework.aspnet.security)