473,775 Members | 2,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

easy question no source is created when a custom event is created

Hello!

Below is a snippet which doesn't work as expected.
Here I create a custom event log named MyLog and a source named MyTest but
when I look at the MyLog the column which should display
the source is empty. It should have displayed MyTest because that is my
source.
It looks like this
Typ Datum Tid Källa ...
Information 2007-10-30 16:16:53

If I click on the above line it display Source: MyTest and a lot of other
information

static void Main(string[] args)
{
EventLog eventLog;

if (!EventLog.Sour ceExists("MyTes t"))
{
EventLog.Create EventSource("My Test", "Mylog");
}

eventLog = new EventLog();

eventLog.Source = "MyTest";
eventLog.Log = "MyLog";

eventLog.WriteE ntry("Test...Te st...Test");
}

//Tony
Oct 30 '07 #1
0 893

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

Similar topics

0
2131
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net X-Trace: fe12.lga 1108528794 24.46.113.251 (Tue, 15 Feb 2005 21:39:54 MST) NNTP-Posting-Date: Tue, 15 Feb 2005 21:39:54 MST Xref: number1.nntp.dca.giganews.com comp.lang.python:398656
2
4594
by: PCC | last post by:
I am using Windows Server 2003 Enterprise Edition. I have a series of custom event log files that were created by an application gone bad. They are all showing up in the event viewer and I am not sure how to get rid of them. Any advice, links or pointers? Please keep in mind that these are NOT the system event log files. Thank you.
2
3546
by: Next | last post by:
Hello all, I have a windows service that was suppose to write some events into its own EventLog. I created the EventLog using the component on VS 2003 toolbar Added an installer for it. Set all the appropriate properties to assign the new Source to a new log. For some reason installutil.exe created the source in the correct log. But
1
1671
by: MAL | last post by:
Hello, I am writing a service program that writes to a custom EventLog. I would like the two classes used in the service to write messages to the same log ideally using a different Source name for filtering etc. So far I am having little luck. I feel that I have been through the documentation extensively but am chasing my tail. It seems like it should be as simple as .CreateEventSource in each class I want to write to the custom log,...
7
2113
by: Shadow Lynx | last post by:
I realize that his question has been asked, in many other forms, many times in this group. Even so, my tired eyes have not yet found a sufficient answer, so I've decided to "reask" it even though I'm sure this will offend some of the more seasoned verterans of this board. The Players: Consider a simple web form, which I'll call Page A, that has a couple of controls on it. It's not important what they are, only that they're static...
8
6615
by: John | last post by:
Is there any special code I have to write to log event to Security Event Log? The following code give me "Very Easy Question, How to write log to SECURTY Event Log? Please help" Error // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.Source = "Security"; // Write an informational entry to the event log. myLog.WriteEntry("Writing warning to event log.",
2
3741
by: T McDonald | last post by:
I've been having a problem writing to an event to the Application log. I believe the issue is caused by the fact that the source was previously both a custom log and the source. I deleted the log using EventLog.Delete(logname); I couldn't delete the source as it there was an error reporting that I couldn't delete the event source as it had the same name as the log. Once I deleted the log, the source appeared to not have any reference to...
2
2376
by: Ole Mercano | last post by:
When I create in Designer a new button on my Form it is automatically named e.g. "button1". When I doubleclick on it I am directed to the Form.cs where the following procedure is automatcially generated: private void button1_Click(Object sender, EventArgs e) { } To improve readability I want to rename now "button1" to "but_change_set".
0
1653
by: =?Utf-8?B?U2hyaWthbnQgTW9yZQ==?= | last post by:
Using enterprise library's 3.1 Logging Application Block , how can i get the custom source name in the windows event log.When ever i am logging an error in windows event log , it gives the source name as Enterprise Library Logging.I want my custom source name instead of Enterprise Library Logging.Also how can i get the username and category also, through Logging Application Block.
0
9622
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10048
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9916
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6718
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2853
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.