Using my.log.writeExcption method to write to event log in a web service

 

I’m trying to use the my.log.writeExcption method to write exceptions to the event log on a web server. I’m having a hard time finding  information on how to set up the web config. There are lots of good examples for my.application.log but not much showing up for my.log from ASP.net.

 

The following is what I have in my web.config:

 

<system.diagnostics>

    <sources>

      <source name="DefaultSource" switchName="DefaultSwitch">

        <listeners>

          <add name="EventLog"/>

        </listeners>

      </source>

    </sources>

    <switches>

      <add name="DefaultSwitch" value="Information"/>

    </switches>

    <sharedListeners>

      <add name="EventLog"

           type="System.Diagnostic.EventLogTraceListener,

           System, Version=2.0.0.0,

           Culture=neutral, PublicKeyToken=b77a5c561934e089"

           initializeData="sample application"/>

    </sharedListeners>

  </system.diagnostics>

 

 

I get an exception saying “Couldn’t find type for class system.Diagnostic.EventLogTraceListner

 

Any tips would be greatly appreciated.

 

Jean-Pierre


Jean-Pierre Seibel
Arcovis LLC
Delivering the Promise of Technology
0
Jean
5/25/2006 4:27:50 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

0 Replies
731 Views

Similar Articles

[PageSpeed] 5
Get it on Google Play
Get it on Apple App Store

Reply:

Similar Artilces:

Can I write to the event log on another computer from my web service?
I have a box that hosts the exception handling web service and then I have 3 other boxes, each hosting a different ASP.Net application. Whenever an excpetion occurs in any of the ASP.Net applications, the exception handling web service method 'HandleException' is invoked from the ASP.Net application. My question is, if I can write to the event log of the originating ASP.Net application's box from my ExceptionHandling web service, that resides on a separate box, and if the above is possible, then what will the code look like for doing this crsoss machine event log writing?    sun2...

Event Log not Logging ??
 Hi All, On my dev machine when I log errors to the event log all works great however when I move the web application to the test server the events are not being logged... I am hoping it is some configuration issue with IIS however I am totally lost.The code writing the events: EventLog.WriteEntry("xxxxx", err, EventLogEntryType.Error);   Any help will be appreciated. Thanks,Neil  are you getting an error? Sometimes, its a permissions issue, if the log name doesn't exist, it tries to write the new value to the registry. Check the application log...

Changing URL in web.config for web service
I added a web reference to asmx file. In web.config - it adds - undefinedadd key="CoreService.CoreServices" value="http://test/CoreServices.asmx I then change it to <add key="CoreService.CoreServices" value="http://test2/CoreServices.asmx"/> But CoreService.CoreServices still looks for http://test/CoreServices.asmx.  What else do i have to change? I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ I think CoreService.CoreServices are hard coded into the source code.  Girijeshhttp://www.girijesh.in/ So no ...

ExceptionPolicy logs differently to event log than to text log
I am implementing an exception policy in the business layer and in the presentation layer of my web application as per the block below.  When an exception happens in the business layer, it bubbles on up to the aspx, which in turn throws the error, thus invoking the default error page defined in web.config.  All well and good.  The strangeness is that only one exception is logged to the event log, but both throws are caught in the text log.  Why the discrepancy? Thanks.    Catch ex As Exception Dim rethrow As Boolean re...

To log or not to log
Hello foremen, on a large database, trillions of SELECTs and DELETEs are going to be performed. After that, the database is going to be unloaded. The database uses a transaction log. Should I keep the log there along this process or "unmount" it after some parts of it (or even before the beginning)? In this case, nothing but the speed is important. The database is ASA 7.0.4.3498. Thanks Pavel LOG... ALWAYS LOG. Performance is dependent on the use of the log. Recommendations: 1) Ensure that the file system is not excessively fragmented 2) Host the db f...

Using Impersonation to write to Event Log
I have simple request.  I have my XML build that houses the UID / Domain / PWD.  The ASP.net site runs great when I do not use impersonate but if an error happens I am unable to write to the Event log.  I am using anonomous access for my users to access the pages.  could someone provide a code snippet on how to access it.  I have tried <impersonate = true> but then it locks the threads I need to call my Crystal Report. remove impersonate=true from your web.config and when ever you want log then use this impersonator class in this example http://www.codeproje...

Logged In As: Not Logged In
I installed ZCF 10.0.1 on a Win 2K3 server and when I install the ZEN client on a workstation the ZENWORKS client login comes up and I cannot log into it. It shows me the realm name of my tree and Zenworks Zone and I have tried both to no avail. When I look at the details of the adaptive agent it says, "Logged In As: Not Logged In" Any ideas? On Fri, 11 Jan 2008 14:55:21 GMT, Jayson E. Hahn wrote: > Any ideas? Debug logs in ZCM http://www.novell.com/support/search.do?cmd=displayKC&docType=kc&externalId=3418069&sliceId=SAL_Public&dialogID=51010132...

Logging log
Hi! I try to accomplish task described in http://forums.novell.com/novell-product-support-forums/zenworks/configuration-management/zcm-server-install/422609-mixed-login.html?pagenumber= and wonder I don't know how to keep log of logging? I mean, does ZCM is capable to keep logging log? As Altiris NS does? More thanks, Alar. -- NovAlf ------------------------------------------------------------------------ You look like you want to log in to your zone as a user from either a eDIR or AD. And yes this is possible, it will search both Directories. http://www.theurbanp...

Logging Application Block not writing to Event Log on Windows 2000 SP4
Hi. I am having issues logging to the Event Log. Although my code is able to log in the Event Log n my Windows XP box with VS2005, when I deploy to the DEV machine it does not. The DEV box has Windows Server 2000 SP4. I've added another loggingConfiguration listener that instead uses the FlatFileTraceListenerData instead of the FormattedEventLogTraceListenerData and it also works both on my local machine and on the DEV server. Just to ensure permissions are not an issue I've setup my website to use a local admin account for Anonymous Access under Authentication Methods. ...

MS Logging Application Block only writes Information type entries in the Event Log
I just started and gone the MS Logging Application Block working fine, except it only stores Information type entries. The previous method System.Diagnostics.EventLog.WriteEntry allowed me to pass an EventLogEntryType which would result in the type and icon appearing in the Event Viewer.  Can anyone tell me how to do this with the MS Logging Application Block or direct me to an example? Thank you!...

Events are being logged to the "Application" log instead of custom log
Hi Pros, I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following:  1 Hi Pros, 2 3 I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following: 4 5 6 EventLog e...

Activity log not logging any events
Hi i have installed the VBSDK kit and it is succesfully running but the activity log does not appear to log any activity, any help in this aspect would be greatly apreciated, Chris The activity log isn't heavily used in the CSK. Mostly it will only log errors related to sending mail or with web services and web service boxes. Generally, if you have no entries in there, it is a good thing.Stephen M. Redd http://www.reddnet.net...

Event Log : Inaccessible logs
 I am getting exception The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security.at if (!EventLog.SourceExists(eventSource)) at function WriteExceptionToEventLogIf i login as windows administrator no problem.If i login as user there the problem occures.        catch (Exception ex)        {            //ex.StackTrace;            //ex.Message;   ...

change a web reference to a web service in the config file of an object used by a windows service
In my solution (visual studios 2005), I have a windows service and a business object.  The business object has a web reference to a web service.  I maid the web reference dynamic and it created an applicationSettings section in the appconfig:<configuration>           <applicationSettings>        <Objects.Properties.Settings>            <setting name="Objects_LookupService_auth"        &nbs...

Web resources about - Using my.log.writeExcption method to write to event log in a web service - asp.net.config-deploy

Resources last updated: 12/19/2015 10:35:19 AM