473,768 Members | 7,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a custom log

UJ
I am trying to have a service write out to a custom log in the event log.
I'm using the following code:
Dim lsEventSource As String = "test1234"
Dim lsEventLog As String = "CustomLog"

If (Not EventLog.Source Exists(lsEventS ource)) Then
EventLog.Delete EventSource(lsE ventSource)
EventLog.Create EventSource(lsE ventSource, lsEventLog)
End If

Dim llogEventLog As EventLog
llogEventLog = New EventLog
llogEventLog.So urce = lsEventSource

llogEventLog.Wr iteEntry("This is a test spot for the event log.")
Can anybody tell me what's wrong with the code? No matter what I put for the
lsEventLog name, it always is being written to the Application log. I've
also tried changing the name of the EventSource to something else just to
see what happens then.....

Nov 21 '05 #1
1 1143
April 15, 2005

The problem is when you create the new event log llogeventlog, you are
not specifying the name of the log...
Dim lsEventSource As String = "test1234"
Dim lsEventLog As String = "CustomLog"

If (Not EventLog.Source Exists(lsEventS ource)) Then
EventLog.Delete EventSource(lsE ventSource)
EventLog.Create EventSource(lsE ventSource, lsEventLog)
End If

Dim llogEventLog As EventLog
llogEventLog = New EventLog
llogEventLog.So urce = lsEventSource
llogEventLog.Lo g = lsEventLog ' Add custom log name
llogEventLog.Wr iteEntry("This is a test spot for the event log.")

This will specify the custom log as the one to write to. Have a great day!

Joseph Bittman MCAD
Microsoft Certified Application Developer
"UJ" <UJ@nowhere.com > wrote in message
news:eA******** ******@TK2MSFTN GP10.phx.gbl...
I am trying to have a service write out to a custom log in the event log.
I'm using the following code:
Dim lsEventSource As String = "test1234"
Dim lsEventLog As String = "CustomLog"

If (Not EventLog.Source Exists(lsEventS ource)) Then
EventLog.Delete EventSource(lsE ventSource)
EventLog.Create EventSource(lsE ventSource, lsEventLog)
End If

Dim llogEventLog As EventLog
llogEventLog = New EventLog
llogEventLog.So urce = lsEventSource

llogEventLog.Wr iteEntry("This is a test spot for the event log.")
Can anybody tell me what's wrong with the code? No matter what I put for
the lsEventLog name, it always is being written to the Application log.
I've also tried changing the name of the EventSource to something else
just to see what happens then.....

Nov 21 '05 #2

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

Similar topics

1
4092
by: T | last post by:
I have a web site i want to deploy using a VS.NEt set up project. I have no problems with that, that is fine and works no problem. But the web application uses a custom event log to log application messages. The asp.net application will not be running under an account with administrative permissions and so this will not be able to create the custom event log.
0
1627
by: Jai | last post by:
Dear All Creating Custom Controls but Not User Controls,How to create custom controls,i.e Extending the functionality of the Existing Controls.(Web Custom Controls). Previously i have submitted the same Query but i got replay for user controls,but my requirement is not that one.My requirement is Custom web controls.
0
2135
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works really fine. No problems at all. But, when this control is placed inside a template of an Infragistics UltraWebTab control, somethings stranges happens: 1. When the WebForm is opened, an "Error Creating Control" message is displayed (for container...
0
1448
by: Julien | last post by:
Hi ! I'm creating a custom control, in which I would render an image with client-side script code to display/hide a calendar control which also belong to my custom control. In this control I've created properties to map onto my calendar UI properties like TodayDayStyle, DayStyle, NextMonthStyle, but I think I should add attributes to these properties to make my control more useable when I will insert it in my pages. For example, I've...
3
1398
by: clsmith66 | last post by:
I hope this is just something stupid I'm missing and someone can easily point out my error. I'm trying to do a few turorials on windows services, and the couple I found so far just create an event log and write an entry on start and stop. I build the projects and install them fine, but when I run the service it starts and stops instantly. The service is not creating the custom event log I wanted it to but instead adds an error message in...
17
1948
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
1
2180
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom controls. Only problem is that I'm used to designing my controls in a WYSIWYG (tm) way (i.e. using the designer and writing HTML tags). The only way I found to create custom controls was to create controls dynamically, set their properties and...
3
1933
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi all, We have a N-Tier framework and we now create a Web Site App to wotk with this architecture. I add reference from my libraries in the project and creating page and controls is very easy, using my objects. But, it's seem that I cannot create report using Crystal Report with my objects. I created classes in the app_Code folder and yes, I can use them but, it's not the way I eant to do it. I want to use my classes from my dlls.
1
2409
by: =?Utf-8?B?QXJ0aHVyIFBhcmtlcg==?= | last post by:
I have been looking for information on creating new custom calendars; not the control, but the class that manages dates and date calculations. The only thing I've been able to find in any of the MS documentation or newsgroups is that you _can_ derive custom calendars from System.Globablization.Calendar, but not a word on what you would need to do to accomplish that. Has anyone ever done or seen any custom calendar implementations? I'd...
0
9576
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
9407
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
10175
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...
0
10017
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...
0
9843
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
7384
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
5283
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...
2
3534
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2808
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.