Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 251119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:34:05+00:00 2026-05-11T21:34:05+00:00

I have a ASMX web services running as ‘network service’. I want to be

  • 0

I have a ASMX web services running as ‘network service’. I want to be able to write to a custom event log every time a web service is called (and when errors happen).

I have created a new event log (MyLog) using the following code running as admin on a Windows server 2008 machine:

                if (!EventLog.SourceExists(APPLICATIONNAME))
            {
                EventLog.CreateEventSource(APPLICATIONNAME, EVENTLOGNAME);
            }
            EventLog.WriteEntry(APPLICATIONNAME, "Service started", EventLogEntryType.Information);

where APPLICATIONAME is “MyApp” and EVENTLOGNAME is “MyLog” (names changed to protect the innocents).

Firstly, it creates a new “MyLog” event log (verified with eventvwr), but its contents are the same as the Application event log. I was expecting to get an empty, non-connected event log.

Secondly, when I try to write to the newly created event log from within the Application_Start method using the following code:

EventLog.WriteEntry(APPLICATIONNAME, "Service started", EventLogEntryType.Information);

I get a SecurityException of type System.Diagnostics.EventLogPermission.

I have tried to change the ACLs of the “MyLog” hive in the registry (as suggested on MSDN) but to no avail.

I’d rather not change the identity of the web service nor change the ACLs on the Application event log which is used by other applications on the system.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:34:05+00:00Added an answer on May 11, 2026 at 9:34 pm

    Since my web service is running in the context of SharePoint, I simply wrapped the call to EventLog.WriteEntry with SPSecurity.RunWithElevatedPrivileges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom desktop application which invokes an ASMX web service. The Service
I have two ASMX web services consumed from javascript. The first service performs a
I have a asmx web service running on a test server that has anonymous
I have a sharepoint web service running at specified host + /_vti_bin/UserProfileWebService.asmx. I would
I am totally confused between WCF and ASMX web services. I have used a
We have a lot of web services (.asmx files, which can be accessed for
I have a web application containing two web services, let's say PublicHello.asmx and RestrictedHello.asmx
I have an asmx web service that should only be allowed to respond to
Im trying to create an ASMX Web Service in Visual Web Developer.I have successfully
I have a .NET web service (using asmx...have not upgraded to WCF yet) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.