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 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-20-2007, 12:25 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
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
Sponsored Links
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 On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-programming/2277-create-eventlog-put-log-entries-c-net.html
Posted By For Type Date
Create EventLog and put log entries in C#.NET | Web Hosting This thread Refback 01-24-2008 02:21 PM


All times are GMT -7. The time now is 11:41 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0