473,401 Members | 2,068 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,401 software developers and data experts.

Event Viewer Logging - Add a new overall type

Hi,

I have Enterprise Library and am using the Logging Application block
successfully to log to the Event log.
Currently I can only put enteries into the existing event viewer types
(Application, Security, etc). Application is best for me currently.

But I would like to add a new overall type called "MyApplication" and
write logs to there instead so that they don't get mixed up with other
apps. On my PC, I have an overall type called "Internet Explorer"
which presumedly is for anything that happens in IE. Can I do the same
thing?

My app would need to be dynamic enough to check that my "MyApp" type
exists first, and if not, create it, and then write the log.

Any ideas?

Cheers,
Steven

May 10 '07 #1
2 5886

"Steven Nagy" <le*********@hotmail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Hi,

I have Enterprise Library and am using the Logging Application block
successfully to log to the Event log.
Currently I can only put enteries into the existing event viewer types
(Application, Security, etc). Application is best for me currently.

But I would like to add a new overall type called "MyApplication" and
write logs to there instead so that they don't get mixed up with other
apps. On my PC, I have an overall type called "Internet Explorer"
which presumedly is for anything that happens in IE. Can I do the same
thing?

My app would need to be dynamic enough to check that my "MyApp" type
exists first, and if not, create it, and then write the log.

At the top of your program.

private System.Diagnostics.Eventlog eventlog1;

http://msdn2.microsoft.com/en-us/lib...kz(VS.71).aspx

This is a VB example, but it's done the same way in C#.

If Not eventlog1.SourceExist("ThePhile.com") Then
eventlog1.CreateEventSource("ThePhile.com"), "My Application")
end if

Then you tie your app to the Eventlog.

eventlog1.source = "ThePhile.com";

So, you put it in a subroutine and execute it a program start.
You can find the eventlog in the registry and delete it, until you get your
naming right.

May 10 '07 #2
On May 10, 5:26 am, Steven Nagy <learndot...@hotmail.comwrote:
Hi,

I have Enterprise Library and am using the Logging Application block
successfully to log to the Event log.
Currently I can only put enteries into the existing event viewer types
(Application, Security, etc). Application is best for me currently.

But I would like to add a new overall type called "MyApplication" and
write logs to there instead so that they don't get mixed up with other
apps. On my PC, I have an overall type called "Internet Explorer"
which presumedly is for anything that happens in IE. Can I do the same
thing?

My app would need to be dynamic enough to check that my "MyApp" type
exists first, and if not, create it, and then write the log.

Any ideas?

Cheers,
Steven
There is another way of doing this:
You can use EventLogInstaller class to install advanced configured
event log sources.

http://msdn2.microsoft.com/en-us/lib...installer.aspx

Good Luck.
May 10 '07 #3

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

Similar topics

9
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
0
by: Eniac | last post by:
Hello, I've started using Enterprise Library 2.0 recently and I've encountered a problem that seems to be ... well... undocumented :) Basically, when I set a Trace Listener (formatted event...
0
by: =?Utf-8?B?YW5rMmdv?= | last post by:
Hi, Thanks in advance for reading this. Not sure where to post this question, but I hope someone in here can help. Trying to write to Event Log in VS 2005 (.NET 2.0) using Enterprise Library...
15
by: Andrew Robinson | last post by:
In the past, I remember all kinds of security related issues when trying to write to the event log but don't remember the specifics. Was there an issue with creating a new source? Can you write...
1
by: dotyet | last post by:
Hi Everyone, I am looking at a lot of entries similar to the following in my Windows 'Audit' Event viewer. They are all success events and not failures. The environment is: DB2 8.2 FP 14...
1
by: mostro713 | last post by:
Hi all, Can someone point me in the right direction? I'm looking for a module to monitor the Windows Event Viewer. Thanks
0
by: Dave | last post by:
I cannot get my application to log to the application event viewer in server '08. it's strange as it works fine on one of my machines, but not on two others (and all similarly configured, i'm...
1
by: anithaapr05 | last post by:
I have got the warning in event viewer when i wrote the code in global.asax session_end(). When the user sessions time out, the Session_End event fires successfully.But i got the waring in event...
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: 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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
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...

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.