My.Log.WriteException not writing to Event Log with ASP.Net 2.0

Discussion in 'ASP .Net Web Services' started by Tom Wingert, Jan 12, 2006.

  1. Tom Wingert

    Tom Wingert Guest

    Hi,
    I am having a problem with getting My.Log.WriteException to write to the
    Event Log in ASP.Net 2.0 with a web service.

    When an error occurs, My.Log.WriteException doesn't log anything to the
    Event Log. Played around with it and ended up adding the following listeners
    to catch and write to the event log by adding the following code in the
    web.config:

    <system.diagnostics>
    <sources>
    <!-- This section defines the logging configuration for
    My.Application.Log -->
    <source name="DefaultSource" switchName="DefaultSwitch">
    <listeners>

    <add name="FileLog"/>

    <!-- Uncomment the below section to write to the Application Event
    Log -->
    <add name="EventLog"/>

    </listeners>
    </source>
    </sources>
    <switches>
    <add name="DefaultSwitch" value="Information" />
    </switches>
    <sharedListeners>

    <add name="FileLog"
    type="Microsoft.VisualBasic.Logging.FileLogTraceListener,
    Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"
    initializeData="FileLogWriter"/>
    <!-- Uncomment the below section and replace APPLICATION_NAME with the
    name of your application to write to the Application Event Log -->
    <add name="EventLog" type="System.Diagnostics.EventLogTraceListener,
    System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    initializeData="My Web Service"/>

    </sharedListeners>
    </system.diagnostics>

    Now My.Log.WriteException will work on my dev machine and write to the event
    log. But when I deploy to the web server and an error occurs, it doesn't log
    the error and it passes back the following error to me:

    Server was unable to process request. ---> Exception has been thrown by the
    target of an invocation. ---> Could not create
    Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic,
    Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
    processorArchitecture=MSIL. ---> Access to the path 'C:\Documents and
    Settings\Default User.WINDOWS\Application Data\Microsoft Corporation\Internet
    Information Services\6.0.3790.1830' is denied.
    TextFile_Module.CreateTextFile - path and text file



    For more information, see Help and Support Center at
    http://go.microsoft.com/fwlink/events.asp.

    I am running XP PRO x64, VS 2005 Final release, Latest .Net Framework 2.0.
    The server is running Win 2003, IIS 6.0, and latest .Net 2.0 Framework.

    Thanks for the help,
    Tom Wingert
     
    Tom Wingert, Jan 12, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik_the_boss
    Replies:
    0
    Views:
    2,660
    Henrik_the_boss
    Nov 5, 2003
  2. =?Utf-8?B?VG9tIFdpbmdlcnQ=?=

    My.Log.Writeexception not writing to Application Event Log.

    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=, Jan 20, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    2,383
    =?Utf-8?B?VG9tIFdpbmdlcnQ=?=
    Jan 20, 2006
  3. rekaeps
    Replies:
    6
    Views:
    649
    Jeff Dillon
    May 5, 2006
  4. orp
    Replies:
    2
    Views:
    5,867
  5. Graham Harris

    Writing ASP.NET errors to the NT Applicaion Event Log

    Graham Harris, May 10, 2005, in forum: ASP .Net Security
    Replies:
    3
    Views:
    199
    Dominick Baier [DevelopMentor]
    May 14, 2005
Loading...

Share This Page