473,386 Members | 1,598 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,386 software developers and data experts.

Events are being logged to the "Application" log instead of custom log

Hi Pros,

I have a weird problem here. I am logging from my .NET app to a custom log, but unfortunately, the events are redirected to the Application log. I am sure that I am specifying the log name and the source name accurately. I am using some code like the following:

Expand|Select|Wrap|Line Numbers
  1. EventLog ev = new EventLog(myLog);
  2.  
  3.             if (EventLog.SourceExists(mySource))
  4.             {
  5.                 if (EventLog.LogNameFromSourceName(mySource) != myLog)
  6.                 {
  7.                     EventLog.DeleteEventSource(mySource);
  8.                     EventLog.CreateEventSource(mySource, myLog);
  9.                 }
  10.             }
  11.             else
  12.             {
  13.  
  14.                 EventLog.CreateEventSource(mySource, myLog);
  15.             }
  16.             ev.Source = mySource;
  17.  
  18.             ev.WriteEntry(message, EventLogEntryType.Error);
HELPPPPP!
Feb 6 '08 #1
0 1035

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: April | last post by:
Hi, I have a function that needs to run whenever a user clicks on any textbox, listbox or combobox on any input forms in my application (there are many forms). Background (in case someone has...
5
by: Rajat Tandon | last post by:
Hello Everybody, Please guide me so that I can fulfill this challenging assisnment ... I have been asked to "Restructure a Windows application" from scratch in 2 months. The existing...
4
by: Keith Chadwick | last post by:
I am having some trouble referencing an Application("myVar") variable from within a module.vb file on my ASP.NET site. According to the documentation I should be able to reference...
2
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form:...
5
by: Scupper | last post by:
Certain "Imports" of classes change the frame of reference within a class such that making calls to functions such as "Application.DoEvents()" and so on becomes ambiguous and gives a "Reference to...
43
by: Christoph Schneegans | last post by:
Hi! Okay, so positions on "text/html" XHTML are totally contradicting. Anyway! I hope there's more consensus about "application/xml" XHTML. I've recently learned that Opera 9.0b2 does not only...
1
by: Electric Co. | last post by:
Hello, I have two questions: 1.) Could I create a custom server control in 2005 in order to leverage the CompositeControl base class and then use that control in 2003? (fingers crossed but...
3
by: ton | last post by:
Hi, I've developed some webcontrols in VB, I'm using these in a website project If the webcontrol is getting an error I ll get the message: Server error in '/' application, and than more...
0
by: clintonb | last post by:
I converted a Web Site project to a Web Application project using the instructions found on this page: http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx One thing I did differently...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.