?
Solved

Eliminate verbage when using app.logevent

Posted on 2006-11-29
2
Medium Priority
?
545 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 1000 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

Industry Leaders: 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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 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