473,666 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My.Log.Writeexc eption not writing to Application Event Log.

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

When an error occurs, My.Log.WriteExc eption 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.diagnos tics>
<sources>
<!-- This section defines the logging configuration for
My.Application. Log -->
<source name="DefaultSo urce" switchName="Def aultSwitch">
<listeners>

<add name="FileLog"/>

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

</listeners>
</source>
</sources>
<switches>
<add name="DefaultSw itch" value="Informat ion" />
</switches>
<sharedListener s>

<add name="FileLog"
type="Microsoft .VisualBasic.Lo gging.FileLogTr aceListener,
Microsoft.Visua lBasic, Version=8.0.0.0 , Culture=neutral ,
PublicKeyToken= b03f5f7f11d50a3 a, processorArchit ecture=MSIL"
initializeData= "FileLogWri ter"/>
<!-- Uncomment the below section and replace APPLICATION_NAM E with the
name of your application to write to the Application Event Log -->
<add name="EventLog" type="System.Di agnostics.Event LogTraceListene r,
System, Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
initializeData= "My Web Service"/>

</sharedListeners >
</system.diagnost ics>

Now My.Log.WriteExc eption 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.Visua lBasic.Logging. FileLogTraceLis tener, Microsoft.Visua lBasic,
Version=8.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a,
processorArchit ecture=MSIL. ---> Access to the path 'C:\Documents and
Settings\Defaul t User.WINDOWS\Ap plication Data\Microsoft Corporation\Int ernet
Information Services\6.0.37 90.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

Jan 20 '06 #1
0 1754

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

Similar topics

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
9
1612
by: Ollie | last post by:
okay sorry for cross posting but want to see if any one can explain the solution to this problem for me: I have a .Net ASP.Net app written in C# that use COM+ components to do some business processing...... When I have the ASP.Net website and the COM+ components installed on the same machine (i.e everything local) it all works fine, and it can write to the event log....
6
1707
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...
1
3005
by: MattB | last post by:
Hi. I need to start logging my application in the Windows Event Log. I found some sample code and it works from a Windows Form. So I put it into my asp.net application and initially had a problem that I found I just needed to create a registry key as outlined in this kb article: http://support.microsoft.com/default.aspx?scid=kb;en-us;329291 So now I get a log entry in my event log, and the entry I specified in the code was: "Invoke...
6
2524
by: rekaeps | last post by:
We are developing an ASP.NET 2.0 (C#) application, and I'm having troubles sending e-mail from the server when accessing the web site from a separate client computer. Also, in the same scenario, I'm having trouble writing to the server's event log. Here's some details: Server and workstation both in the same workgroup Logged into server as local Administrator Logged into workstation as a local user that is only in the Users group on
6
3398
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. This application has to write to the application event log. After deployment of the application I have verified that my source “MySource” exists in the Application event log. I then wrote some text to the event source in a forms app and...
10
6637
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
1
2180
by: =?Utf-8?B?TWljaGFlbCBCbHVtZW50aGFsLCBNQ1NFLCBNQ0FE | last post by:
I am writing a .NET 1.1 C# windows service that writes to a dedicated event log (not the application event log, but one that I created). I want to make full use of all the fields in an event log record - category, event ID, etc. I would like to make use of a message file as well. I have created a message file DLL per the instructions at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wes/wes/sample_message_text_file.asp...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8352
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8780
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
8549
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
7378
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 projectplanning, coding, testing, and deploymentwithout 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...
0
5661
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
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2005
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.