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

My.Application.Log.WriteEntry Is Cool, But Formated Information SUCKS

Has any one figured out how to override the WriteEntry or show change
the actual output?

I am sorry, but putting the DATE/TIME PROCESS # and Thread #
information AFTER the 'Message' text just sucks and makes it horrible
for human readability.

For example...

DefaultSource Information 0 This is a message 2006-05-13
18:21:58Z 472 10

Should be...

2006-05-13 18:21:58Z DefaultSource Information 0 472 10 This is a
message

What brain dead decision was made to put the VARIABLE sized data in the
MIDDLE of the standard formatting?

And, the inability to remove the SOURCE and SWITCH information? Like
any user will have a clue. We have no end of customers using our code
that GRIPE about this CRAPPY formatting. We may have to go back to our
custom Trace Listener, which sucks too, because the
My.Application.Log.WriteEntry is SO EASY to use.

May 21 '06 #1
3 6110
I would use this sub below. you can create your own event log on the
pc.

Public Shared Sub LogErrorToLocalEventLog(ByVal ex As Exception)
' Create the source, if it does not already exist.

Dim myLogName As String = "Name Event Log here"

If Not EventLog.SourceExists(ERROR_SOURCE) Then

EventLog.CreateEventSource(ERROR_SOURCE, myLogName)

Else

myLogName =
EventLog.LogNameFromSourceName(ERROR_SOURCE, ".")

End If

' Create an EventLog and assign source.

Dim myEventLog As New EventLog

myEventLog.Source = ERROR_SOURCE

myEventLog.Log = myLogName

' Set the 'description' for the event.

Dim myEventLogEntryType As EventLogEntryType =
EventLogEntryType.Warning

Dim myApplicatinEventId As Integer = 1100

Dim myApplicatinCategoryId As Short = 1

' Write the entry in the event log.

myEventLog.WriteEntry(ex.Message & vbCrLf & ex.StackTrace,
myEventLogEntryType, myApplicatinEventId, myApplicatinCategoryId)

End Sub
Dachshund Digital wrote:
Has any one figured out how to override the WriteEntry or show change
the actual output?

I am sorry, but putting the DATE/TIME PROCESS # and Thread #
information AFTER the 'Message' text just sucks and makes it horrible
for human readability.

For example...

DefaultSource Information 0 This is a message 2006-05-13
18:21:58Z 472 10

Should be...

2006-05-13 18:21:58Z DefaultSource Information 0 472 10 This is a
message

What brain dead decision was made to put the VARIABLE sized data in the
MIDDLE of the standard formatting?

And, the inability to remove the SOURCE and SWITCH information? Like
any user will have a clue. We have no end of customers using our code
that GRIPE about this CRAPPY formatting. We may have to go back to our
custom Trace Listener, which sucks too, because the
My.Application.Log.WriteEntry is SO EASY to use.


Jun 3 '06 #2
This is a good example, thanks, and I could do it and have done such in
the past. But it does not address my question... I want to use
My.Application.Log.WriteEntry() but force the output of the method to a
format that makes sense to a human, Microsoft' s formatting options are
horrible, and so inflexible that it is reporting that I would NEVER let
my clients see. Just that bad.

Jun 4 '06 #3
This is a good example, thanks, and I could do it and have done such in
the past. But it does not address my question... I want to use
My.Application.Log.WriteEntry() but force the output of the method to a
format that makes sense to a human, Microsoft' s formatting options are
horrible, and so inflexible that it is reporting that I would NEVER let
my clients see. Just that bad.

Jun 4 '06 #4

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

Similar topics

0
by: Manfred Braun | last post by:
Hi All, I am trying to fetch system-events, and I am successful with "TimeChanged", but cannot get "SessionEnding". I am not an OO expert and so - just to be sure - I made all my methods public...
0
by: Rhon Stewart via DotNetMonster.com | last post by:
Hi please visit this link : http://www.eggheadcafe.com/articles/pfc/selfupdater.asp I followed all the steps for listed on the link , when I execute the application it it gives me the following...
5
by: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting for the connection from client. When the Client...
7
by: Lucas | last post by:
Hi, I have an ASP.Net application written with VS.Net 2002 (Net FWK 1.0). This Web Application uses Exception Management Application Block to log Events to Windows Event Log. We registered the...
4
by: Aaron Hackney | last post by:
Hello. I am writing a service that I would like to have write access to the Application event log. Since the service is running as a system account, it would appear that I do not have access....
1
by: MattB | last post by:
Hi. I need to start logging my application in the Windows Event Log. I found some sample code and it works from a Windows Form. So I put it into my asp.net application and initially had a problem...
0
by: Dachshund Digital | last post by:
Has any one figured out how to override the WriteEntry or show change the actual output? I am sorry, but putting the DATE/TIME PROCESS # and Thread # information AFTER the 'Message' text just...
3
by: sk.rasheedfarhan | last post by:
Hi all, According to my project requirement I have to write the NT Event information of SQL Server into EventLog viewer. For more clear I want to write the following information into...
6
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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,...
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
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...
0
agi2029
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,...
0
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...

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.