RE: Trace Viewer
From: Mike Hayton [MS] (mikehayt__at_online.microsoft.com)
Date: 07/28/04
- Next message: Mike Hayton [MS]: "RE: Creating a eventsink based off the Sql Server Basic Log Event Sink"
- Previous message: Mike Hayton [MS]: "RE: EIF Installation error - 1722"
- In reply to: venkat: "Trace Viewer"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 28 Jul 2004 02:06:48 GMT
This question was answered via straight email.
The ultimate response was (from memory):
- no way from the current API of reading in a random acess form. The
underlying unmanaged API (ProcessTrace()) doesnt allow this.
- it was recommended that you roll over the log files at a regular time
interval, so they are in more managable sizes (I'll attach a script to the
end of this email to do this).
- with truely large volumes of data, it really becomes necessary to upload
it into a DB and perform SQL queries on it to slice and dice it.
Cheers
Mike
==============================
wscript.echo "Script started ..."
dtNow = Now
sNow = Year(dtNow) & Right("0" & Month(dtNow),2) & Right("0" &
Day(dtNow),2) & "T" & Right("0" & Hour(dtNow),2) & Right("0" &
Minute(dtNow),2) & Right("0" & Second(dtNow),2)
Set traceSettings =
CreateObject("Microsoft.EnterpriseInstrumentation.Configuration.TraceSetting
s")
strTraceConfigFile = traceSettings.GetConfigFileLocation()
traceSettings.load(strTraceConfigFile)
Set colTraceSessions = traceSettings.TraceSessions
For Each traceSession In colTraceSessions
wscript.echo "Trace Session Name: " & traceSession.Name
wscript.echo "Trace Session Log Name: " & traceSession.FileName
wscript.echo "Trace Session Status: " & traceSession.Enabled
If traceSession.Enabled Then
path = Left( traceSession.FileName, InStrRev( traceSession.FileName, "\"
) )
traceSession.FileName = path & traceSession.Name & "_" & sNow & ".log"
wscript.echo "New Trace Session Log Name: " & traceSession.FileName
End If
Next
'Since the trace session.config file has been changed we need to save it
If traceSettings.IsDirty Then
wscript.echo "Saving configuration changes"
traceSettings.Save
End If
wscript.echo "Script terminated."
--------------------
|
| We are using trace viewer to view the logs generated by EIF. This is a
just sample program that comes along with EIF (as a source). This viewer is
absolutly not capable of viewing large files say more than 300 MB.
Ofcourse, when you instrument your application for months, you may get log
files in GB. Is there any other viewers are available to view these large
files?
|
| I tried to write one trace viewer using virtual list view control. But
the EIF provides only one method TraceLogReader.ReadLogFile to read all the
events once at file level. This method reads the entire file. Is there any
other methods provided reading one event at a time instead of reading
entire file once? (Very poor framework?!) In this way, I can achieve this
virtual list view control based trace viewer.
|
| Any help would be highly appreciable.
|
| thank you...
|
|
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
- Next message: Mike Hayton [MS]: "RE: Creating a eventsink based off the Sql Server Basic Log Event Sink"
- Previous message: Mike Hayton [MS]: "RE: EIF Installation error - 1722"
- In reply to: venkat: "Trace Viewer"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|