By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,534 Members | 1,830 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,534 IT Pros & Developers. It's quick & easy.

Write to application EventLog

P: n/a
Hi all,

According to my project requirement I have to write the NT Event
information of SQL Server into EventLog viewer.

For more clear I want to write the following information into
Application log file:
------------------------------------------------------------------------------------------------------

Event ID :17055
Source :MSSQLServer
Date : xx-xx-xx
Time :xx-xx-xx
User :xxxxxx
Category :xxx
Computer :xxxx
Type :Information
Description:
17148 :
SQL Server is terminating due to 'stop' request from Service Control
Manager.
------------------------------------------------------------------------------------------------------

Through code I have to enter the above information into Application
Event Log. So I am able to write any event from "EventLog class"
through C#. But the event generated is not having the proper
description. It is having the following description:
[General one not specific to any eventid and source]
Source : Application
EventID : 0
Description :
The description for Event ID ( 0 ) in Source ( Application ) cannot be
found. The local computer may not have the necessary registry
information or message DLL files to display messages from a remote
computer. The following information is part of the event: Writing to
event log.
My Major Problem:
If I given EventID = 17055 and Source = MSSQLSERVER so how can I write
the above log information in the Event Log.And also, is it possible to
retrieve the description of the NT event from the EventMessageDLL?

Let me know ASAP.
Hope someone can help.
Sincerely
Rasheed.

Jun 15 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.