Solved

Eliminate verbage when using app.logevent

Posted on 2006-11-29
2
542 Views
Last Modified: 2008-01-09
I'm using app.logevent in my VB applications to log different events, assignments, etc.  Everything works but I receive more information than I would like in the log file.  The following is an example of what is recorded:

Information Application E:\Log\ApplicationName.log: Thread ID: 848 ,Logged: This is a test

Everything prior to "This is a test" comes from the system.  Is there a way to eliminate this verbage?
0
Comment
Question by:TheChos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
weiroblpay earned 250 total points
ID: 18046981
As far as I can tell, you can't. The App.LogEvent method doesn't have very much flexibility in it.

You can use APIs to write to the NT event log if you want, but you get the same problem with extra verbiage.
http://www.montgomerysoftware.com/WritingToNTEventLogInVB.aspx

If you want to write a log file that has only the information you want in it, then you will have to create that method yourself.
If you create a class wrapper for the functions you want, then it's easy to drop it into any application and use that as your logging.

Good luck.

0
 

Author Comment

by:TheChos
ID: 18047743
Creating a class is an excellent idea.  I think I'll go that route.  Thanks for your help.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question