IT Community - Software Programming, Web Development and Technical Support

Create EventLog and put log entries in C#.NET

This is a discussion on Create EventLog and put log entries in C#.NET within the C# Programming forums, part of the Software Development category; Creating Event Log in Windows service. Goals: This project is used to create an eventlog in Windows Service using C#. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 07-19-2007, 11:25 PM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
oxygen is on a distinguished road
Default Create EventLog and put log entries in C#.NET

Creating Event Log in Windows service.

Goals:

This project is used to create an eventlog in Windows Service using C#.

Steps:

1) Create a C# windows service.

2) Copy the following code.

if (!EventLog.SourceExists("DcRawImage"))
{
EventLog.CreateEventSource("DcRawImage", "DcRawImage");
}
eventLog = new EventLog("DcRawImage", Environment.MachineName, "DcRawImage");

eventLog.WriteEntry("Service Started");

3) run the service.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create SubDomains Simran1 PHP Programming 1 01-08-2009 12:06 AM
How do I create a floating div? Pvinothkumar HTML, CSS and Javascript Coding Techniques 2 09-18-2007 09:27 PM
How to create ISO Files? $enthil C# Programming 0 09-17-2007 12:20 AM
create resource sivakumar C# Programming 1 07-27-2007 07:37 AM
How do create Sub Domain? raj Server Management 0 07-17-2007 03:08 AM


All times are GMT -7. The time now is 04:10 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0