Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > writing to event log

Reply
Thread Tools

writing to event log

 
 
Guest
Posts: n/a
 
      06-23-2005
Hi
Does any body know how to register my own eventlog source?
and how to register my own category and eventid for the eventlogentry?


TIA

--



 
Reply With Quote
 
 
 
 
Parag
Guest
Posts: n/a
 
      06-24-2005
Hi,
You need to create an object of System.Diagnostics.EventLog. This will enable you to create the event log and write to it.
The sample code in C# for it could be
System.Diagnostics.EventLog eventLog =

new System.Diagnostics.EventLog();

// Create the source if it does not already exist

if( !System.Diagnostics.EventLog.SourceExists(

this._EventLogSource) )

{

System.Diagnostics.EventLog.CreateEventSource(

this._EventLogSource, this._EventLogName);

}

// Code for writing to event log.

Regards,

Parag Kulkarni

<dl> wrote in message news:(E-Mail Removed)...
> Hi
> Does any body know how to register my own eventlog source?
> and how to register my own category and eventid for the eventlogentry?
>
>
> TIA
>
> --
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing to a remote event log..... Ollie ASP .Net 10 11-14-2008 09:17 AM
ASP Problem: "IIS log failed to write entry" in Event Log cherryparadise001@gmail.com ASP General 0 05-26-2006 01:52 AM
My.Log.Writeexception not writing to Application Event Log. =?Utf-8?B?VG9tIFdpbmdlcnQ=?= ASP .Net 0 01-20-2006 06:41 PM
My.Log.WriteException not writing to Event Log with ASP.Net 2.0 Tom Wingert ASP .Net Web Services 0 01-12-2006 06:46 PM
Need help on the Permissions needed to log to Event Log from ASP.NET? Henrik_the_boss ASP .Net 0 11-05-2003 10:14 AM



Advertisments