473,624 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Custom Event Logs

I'm having trouble creating a custom event log.

Here's my Code:

static void Main(string[] args)
{
if (!EventLog.Sour ceExists("Onlin eTonnages"))
EventLog.Create EventSource("On lineTonnages"," EWC
Applications",E nvironment.Mach ineName);

EventLog ApplicationLog = new EventLog();
ApplicationLog. Source = "OnlineTonnages ";
ApplicationLog. MachineName = Environment.Mac hineName;
ApplicationLog. Log = "EWC Applications";

ApplicationLog. WriteEntry("Tes t!");

}

It compiles and runs without error.. However, when I check the Event Viewer
to see if my log contains the test message I find that although the log has
been created and appears in the Event Viewer the Events don't go against the
log. Instead they appear in the application log with the following message:

"The description for Event ID ( 0 ) in Source ( OnlineTonnages ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: Test!"

Is this a bug in the framework or something i'm doing incorrectly?

Simon.
Nov 16 '05 #1
1 5399
Ensure that
HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\EWC
Applications\On lineTonnages\Ev entMessageFile is pointing to
EventLogMessage s.dll

On my system the path is
C:\WINDOWS\Micr osoft.NET\Frame work\v1.1.4322\ EventLogMessage s.dll

"Simon Johnson" <ck***@hotmail. com> wrote in message
news:c8******** **@sparta.btint ernet.com...
I'm having trouble creating a custom event log.

Here's my Code:

static void Main(string[] args)
{
if (!EventLog.Sour ceExists("Onlin eTonnages"))
EventLog.Create EventSource("On lineTonnages"," EWC
Applications",E nvironment.Mach ineName);

EventLog ApplicationLog = new EventLog();
ApplicationLog. Source = "OnlineTonnages ";
ApplicationLog. MachineName = Environment.Mac hineName;
ApplicationLog. Log = "EWC Applications";

ApplicationLog. WriteEntry("Tes t!");

}

It compiles and runs without error.. However, when I check the Event Viewer to see if my log contains the test message I find that although the log has been created and appears in the Event Viewer the Events don't go against the log. Instead they appear in the application log with the following message:
"The description for Event ID ( 0 ) in Source ( OnlineTonnages ) cannot be
found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be
able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Test!"
Is this a bug in the framework or something i'm doing incorrectly?

Simon.

Nov 16 '05 #2

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

Similar topics

0
1589
by: Peter Rennie | last post by:
The System.Diagnostics.EventLog class allows you to create custom event logs. The logs are created with a default size of 512KB and 7 days retention. Does anyone know of a way to change these settings this programmatically? Thanks Peter
0
1860
by: Steve DeLong | last post by:
I have a set of C++ applications that all use a common message DLL. I am working on a .NET Service that I would also like to use this same message DLL. From what I have read, this should work properly: System.Diagnostics.EventLog.WriteEntry("MySource", "My Message", EventLogEntryType.Information, 100, 9); where I want the severity to be Information, the message Event ID in my
5
1637
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 issue is, broadly, that when I try to write to the Windows Event Log from ASP.NET code I receive a System.Security.SecurityException ("Requested registry access is not allowed").
7
3337
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid, theres a requirement to show a drop down menu list (this is a control I downloaded online) in one of the columns. For the purposes of this question, Ive implemented the drop down menu as a drop down list instead. Ive got all this working at this...
1
1171
by: RandyJ | last post by:
I created a custom log by following a walkthrough. It created NewLog1. I logged several things successfully. I then tried to delete it and send my error messages to the Application log. The problem is that they still go to NewLog1 which doesn't show up in the Event Viewer because I deleted it. I have found the file NewLog1.evt and verified that the file is still receiving the error messages(they are appending) that I am trying to sending to...
0
1200
by: lightning-dave | last post by:
We have a custom logshipping solution set up between two of our SQL Clusters - both running SQL 2000 Ent Edition. The process is as follows: 1) A job runs every 15 mins to back up the transaction log on the live server. After each transaction log backup is complete a flag is set in a monitoring table to indicate that the log is ready to send. 2) A job runs every 2 mins and checks if there are any transaction log
2
1550
by: John Smith | last post by:
I have created a windows service that logs errors to the EventLog. I want the logs to go to an EventLog I have created. However, I am finding that the event is not logging to the created EventLog instead it is logging to Application log. What could be the problem? ======================================================================== SYSTEM DETAILS: ======================================================================== ...
1
2055
by: Ryan | last post by:
I am trying to log events to SQL Server instead of the computers event log, but, although I get no errors, I have no luck. The webevents_events table is empty. I have a custom event that I am raising (passwordchange), and can see it beign raised successfully...just it seems to go nowhere. I have run aspnet_regsql to setup the database to handle event recording. I am fairly sure I am missing something in my web.config file. (I would...
0
1263
Carrugar
by: Carrugar | last post by:
Hi folks, was hoping someone might have some suggestions to a major PITA problem I'm having! I have a function below which resides in an ASP file. It creates a URL using the strParams variable then submits it using MSXML and the .URL method. After several successful iterations, the function hangs and I get an error in the IIS logs (shown below): Function jsDoesFileExist(strFileName) dim xml dim strURL dim sURL dim strParams
0
8170
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
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
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
8474
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...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
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
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
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.