Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
juicyapple
Posting Yak Master
176 Posts |
Posted - 2008-02-26 : 20:26:57
|
Hi, I tried to write entry to event log, but I found that in the DB Maintenance log I created, there are also lots of events from other sources (eg. MSSQLSERVER, Userenv, SceCli...), how do I create only the log for my application? If Not objEventLog.SourceExists(AppName) Then objEventLog.CreateEventSource(AppName, LogName) 'AppName = DB Maintenance Service 'LogName = DB Maintenance End If objEventLog.Source = AppName objEventLog.WriteEntry(Entry, EventType) 'Entry = message to write |
|
jsmith8858
Dr. Cross Join
7423 Posts |
|
juicyapple
Posting Yak Master
176 Posts |
Posted - 2008-02-26 : 21:42:58
|
the link just shows the way to create a log and write entry into it. I can create the log and also writting message into it, but the log also have other messages from other sources...Please advise. |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-02-26 : 21:56:40
|
The very first result returned explains how to create a new custom event log!quote: You can use the EventLog class to create a custom event log on a local or remote computer. You might create a custom log if you wanted to organize your entries in a more granular way than is allowed when your components write entries to the default Application log.
- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
juicyapple
Posting Yak Master
176 Posts |
Posted - 2008-02-27 : 20:19:27
|
It is strange that when I tried to create some new log, some can be created, some cannot....eg.'AppName = DB Maintenance Service'LogName = DB Maintenance Log'no log created'AppName = DB Maintenance Service'LogName = My Log' log created successfully... |
|
|
|
|
|