Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Writing to the event log with a Web Service (VB.Net)

Back to Forum: Tech Off
  • User profile image
    Code​Monkey666


    I prototyped my code in a windows application and the event logging works fine. When I move the classes to my Web Service no events are written.

     

    Do I need to add the ASPNET group somewhere or is this not possible with 2003?

     

    I can post my code if needed =)

  • User profile image
    W3bbo

    The account your ASP.NET app runs under needs to have write access to the Registry and Event Log. Check your Group Policy and ADUC settings.

  • User profile image
    cpod

    How are you writing to the event log?
    Something along the lines of:


    EventLog.WriteEntry("MySource", "My Message")

    The problem could be that MySource doesn't exist. You would normally create it by doing something like:


    If Not EventLog.SourceExists("MySource") Then
    EventLog.CreateEventSource("MySource", "Application")
    End If

    I don’t think the IIS account has permission to write to the registry so your installer will need to create the event log source and give the IIS account permission to write to it.

    The source is created under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application, unless you are using a custom log.

  • User profile image
    Code​Monkey666

    Thanks for the info! I will do some testing Big Smile

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.