473,671 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Writing to EventLog

I've created a new EventLog for mail services in my web application. Each
time a mail is sent, it is recorded in the eventlog for later review. This
works fine when I am on my development machine (Windows XP Pro), but when I
try to do this on my test server (Windows 2003) I get the security error
message that I don't have the permissions to write to the log.

The EventLog is my own, not one of the base 3 that is in Windows. I saw how
to change the permissions in the registry to allow ASPNET permission to
access the logs, but I don't want that, thus the reason for creating my own
EventLog.

Is there a way to provide permission to ASPNET for specific EventLogs?

Thanks in advance.
Aug 29 '08 #1
2 1296
you need to add your custom eventlog node to the registery and set
permission. as asp.net is not an admin on the test box, you must do this for
it.

-- bruce (sqlwork.com)
"DJ" wrote:
I've created a new EventLog for mail services in my web application. Each
time a mail is sent, it is recorded in the eventlog for later review. This
works fine when I am on my development machine (Windows XP Pro), but when I
try to do this on my test server (Windows 2003) I get the security error
message that I don't have the permissions to write to the log.

The EventLog is my own, not one of the base 3 that is in Windows. I saw how
to change the permissions in the registry to allow ASPNET permission to
access the logs, but I don't want that, thus the reason for creating my own
EventLog.

Is there a way to provide permission to ASPNET for specific EventLogs?

Thanks in advance.
Aug 29 '08 #2
What you could do is create a Class and have that write to your EventLog.
I've done that and its used by an web app and web service and I didn't have
to setup any special permission for it to work.

"DJ" <DJ@discussions .microsoft.comw rote in message
news:1D******** *************** ***********@mic rosoft.com...
I've created a new EventLog for mail services in my web application. Each
time a mail is sent, it is recorded in the eventlog for later review. This
works fine when I am on my development machine (Windows XP Pro), but when
I
try to do this on my test server (Windows 2003) I get the security error
message that I don't have the permissions to write to the log.

The EventLog is my own, not one of the base 3 that is in Windows. I saw
how
to change the permissions in the registry to allow ASPNET permission to
access the logs, but I don't want that, thus the reason for creating my
own
EventLog.

Is there a way to provide permission to ASPNET for specific EventLogs?

Thanks in advance.

Aug 29 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1383
by: Jacob Colding | last post by:
Hello, I have created a a logging mechanism, that writes mesages to a custom event log. On each check it verifies whether the requested source is registered to the "IPS" log. If not, it changes the registration. My problem is that *some* messages still goto the application log, even with this code. I have stepped through the code and verified that the logName variable actually contains the value "IPS", but it still does not go into my...
2
4189
by: Scott Vercuski | last post by:
Everyone, I'm having trouble writing an event to the event log. Here is the chunk of code I currently have. ----------------------------------------------------------------------- Private Shared Function WriteErrorToLog(ByVal objError As System.Text.StringBuilder, ByVal strSource As String) As Boolean Dim objEL As New EventLog Dim blnreturnvalue As Boolean
5
4024
by: David Conorozzo | last post by:
I am able to create new sources using CreateEventSource. I can call GetEventLogs, I can delete sources, I can see if sources exist BUT, as soon as I try a "WriteEntry", I get an exception: {System.InvalidOperationException} : {System.InvalidOperationException} HelpLink: Nothing InnerException: {System.ComponentModel.Win32Exception}
2
1435
by: Marauderz | last post by:
OK this just seems to be a common question being asked around here, I've tried Google Grouping the question but I still haven't came up with a solution yet. So here goes... I'm getting the Security Exception about being Unable to Access a Registry Key when trying to write to my custom event log. the Eventlog I'm trying to write to, has already been created via an Installer class
6
1708
by: MattC | last post by:
I have some code that correctly writes to the eventlog on my local machine. I have installed the application on the Live server and all is not well, no event log entries. My development box config is as follows: Windows XP Pro running IIS 5.1 Web app using integrated auth using a local user account Account has admin right over machine. Entry has been placed in registry in
2
3211
by: MattB | last post by:
I'm writing some code to log errors in a web app (vb/asp.net). I found a straightforward-looking example here: http://www.c-sharpcorner.com/Code/2002/May/CustomErrorHandlingASPNEt.asp But mine doesn't seem to be working. If I step through the code I put in global.asax.vb it seems to get to the line where it checks for the existence of the log and then returns without writing anything to the event log. I don;t know why or how to...
0
376
by: Karthik Srinivasan | last post by:
Hi, My web application which runs on Windows 2003 server writes to EventLog during application startup but I get the following exception Requested registry access is not allowed. at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex)
9
11001
by: Jerry C | last post by:
I am trying to write to the errorlog and I am getting the error Cannot open log for source 'Application'. You may not have write access. This is the code: Dim Logevent As New EventLog("Application") Logevent.Source = "Application" Logevent.WriteEntry("Log In Error ", EventLogEntryType.Error)
10
6638
by: David Thielen | last post by:
Hi; I am trying to write to the event log using: public const string EVENT_LOG_NAME = "Windward Portal"; if (!EventLog.SourceExists(EVENT_LOG_NAME)) EventLog.CreateEventSource(EVENT_LOG_NAME, "Application"); And I am getting the exception: System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +48
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.