473,327 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Problem writing to custom eventlog

Hello,

I have created a a logging mechanism, that writes mesages to a custom event
log. On each check it verifies whether the requested source is registered to
the "IPS" log. If not, it changes the registration. My problem is that
*some* messages still goto the application log, even with this code. I have
stepped through the code and verified that the logName variable actually
contains the value "IPS", but it still does not go into my own log.

I know that the docs, specify the redirecting to a different eventlog, will
not take effect until the system is restarted - i DID restart (several
times) but some log messages still end up in the application log. any
ideas??

************************************************** ****'
lock (_EventLogLockObject)
{
if (!EventLog.SourceExists(source))
{
EventLog.CreateEventSource(source, "IPS",
System.Environment.MachineName);
}
else
{
string logName = EventLog.LogNameFromSourceName(source,
System.Environment.MachineName);
if (logName != "IPS")
{
EventLog.DeleteEventSource(source);
EventLog.CreateEventSource(source, "IPS",
System.Environment.MachineName);
}
}
EventLog evLog = new EventLog("IPS", System.Environment.MachineName,
source);
evLog.WriteEntry(message, entryType);
}
************************************************** *****

-Jacob
Jul 21 '05 #1
0 1352

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Marauderz | last post by:
OK this just seems to be a common question being asked around here, I've tried Google Grouping the question but I still haven't came up with a solution yet. So here goes... I'm getting the...
5
by: Dan Brill | last post by:
Hi, I'm sure this issue has been covered before but after searching around I can't find anything which deals with quite the same set of circumstances or suggests an optimal solution. The...
0
by: Jacob Colding | last post by:
Hello, I have created a a logging mechanism, that writes mesages to a custom event log. On each check it verifies whether the requested source is registered to the "IPS" log. If not, it changes...
12
by: Martyn Fewtrell | last post by:
Hi there I'm trying to find the correct way to write exceptions to the Application log using Vb.Net. I've done a fair bit of Googleing and although this gets plenty of mentions and that this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.