Solved

Eliminate verbage when using app.logevent

Posted on 2006-11-29
2
543 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

691 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