I have the following code in a class...
---------------------------------------------------------------------------------
....
Private _eL As EventLog = Nothing
Private _eLName As String = My.Settings.Eve ntLogName
Private _sourceName As String
Private Sub New()
' Require user passes source name.
End Sub
Public Sub New(ByVal EventSourceName As String)
_eL = New EventLog(_eLNam e, My.Computer.Nam e, EventSourceName )
' This will ensure that the event source is registered w/ the EMSL
event log.
If EventLog.LogNam eFromSourceName (EventSourceNam e,
My.Computer.Nam e).Trim.Length 0 _
And EventLog.LogNam eFromSourceName (EventSourceNam e, My.Computer.Nam e)
<_eL.Log Then
EventLog.Delete EventSource(Eve ntSourceName, My.Computer.Nam e)
End If
_eL.CreateEvent Source(EventSou rceName, _eL.Log, My.Computer.Nam e)
_sourceName = EventSourceName
End Sub
....
Public Sub WriteEvent(ByVa l Message As String, ByVal EventType As
EventLogEntryTy pe, Optional ByVal ID As Integer = 68)
EventLog.WriteE ntry(_sourceNam e, Message, EventType, ID)
End Sub
....
---------------------------------------------------------------------------------
The eventlog gets created, but the events are always written to the
Application eventlog.
Please, help.
Thanks,
Jacob 1 3559
Never mind...
The source had an illegal character.
thanks anyway. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 the paramenter. Im using the
TransactedInstaller class to do this. In order to know the
output from the installation I call the installation as
this to get a log of the installation.
|
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 for C/C++.
What I have found in MSDN so far can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/message_files.asp
and...
|
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
|
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 assigned this domain account to IIS_WPG
group, and also assigned this domain account all priviledges that NETWORK
SERVICE has in local security policy mmc ... but when we try to use
System.Diagnosis.EventLog.WriteEntry("source", "test") we got access...
|
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,...
| |
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 Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at System.Diagnostics.EventLog.CreateEventSource(String source, String
logName, String machineName, Boolean useMutex)
|
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 log?! I have simplified my code into this tiny
snippet:
EventLog.CreateEventSource("mySrc", "myLog1");
|
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 resourceful.mc content is like this.
MessageId=0x1
Severity=Success
SymbolicName=INSTALL_CATEGORY
|
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 the .NET installer program is registering my service as an standard Application EventLog source - making it impossible for my Service to have it's own EventLog (unless I delete the installer created EventLog registry entry after the installation of...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| | |