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

EventLog.WriteEntry(source, message) does not write to source

I have the following code in a class...

---------------------------------------------------------------------------------
....
Private _eL As EventLog = Nothing
Private _eLName As String = My.Settings.EventLogName
Private _sourceName As String

Private Sub New()
' Require user passes source name.
End Sub
Public Sub New(ByVal EventSourceName As String)
_eL = New EventLog(_eLName, My.Computer.Name, EventSourceName)

' This will ensure that the event source is registered w/ the EMSL
event log.
If EventLog.LogNameFromSourceName(EventSourceName,
My.Computer.Name).Trim.Length 0 _
And EventLog.LogNameFromSourceName(EventSourceName, My.Computer.Name)
<_eL.Log Then
EventLog.DeleteEventSource(EventSourceName, My.Computer.Name)
End If

_eL.CreateEventSource(EventSourceName, _eL.Log, My.Computer.Name)
_sourceName = EventSourceName
End Sub
....
Public Sub WriteEvent(ByVal Message As String, ByVal EventType As
EventLogEntryType, Optional ByVal ID As Integer = 68)
EventLog.WriteEntry(_sourceName, Message, EventType, ID)
End Sub

....
---------------------------------------------------------------------------------

The eventlog gets created, but the events are always written to the
Application eventlog.

Please, help.

Thanks,
Jacob

Sep 9 '08 #1
1 3494
Never mind...
The source had an illegal character.
thanks anyway.
Sep 9 '08 #2

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

Similar topics

0
by: Erick | last post by:
Hi, Does any one know how to avoid to register of the event log source by the TransactedInstaller object? I have a service which have some code into the main method to self-register base on...
1
by: john s | last post by:
I am trying to create a message text file for the Catagory field in order to map the catagory input number to a string text. I have found some MSDN information on this, but it appears to only be...
2
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...
3
by: John Lee | last post by:
Hi, we have been trying so many days and could not figure it out - please help!!! in windows 2003, we created an application pool and assigned a domain account as its identity - we also...
1
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...
0
by: Karthik Srinivasan | last post by:
Hi, My web application which runs on Windows 2003 server writes to EventLog during application startup but I get the following exception Requested registry access is not allowed. at...
1
by: martin | last post by:
Hi, I'm having some problems with the System.Diagnostics.EventLog class in .NET 2.0 I need to recreate an event message source inside a new log but the messages keeps ending up in the old...
0
by: rene | last post by:
I'm trying to use costome categories in my eventlog for a program I'm writing. But I have some problems with it, I cant get it to work. Checklist for how I did this. 1. Created a...
0
by: pbh | last post by:
Hi all I've written a Service application and it must use it's own EventLog. The Service is checking if it is registered as EventLog source, and if not it creates it's own EventLog. Unfortunately...
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.