Groups | Blog | Home
all groups > visual studio .net enterprise tools > march 2005 >

visual studio .net enterprise tools : EIF - Trace Service won't use network path?


Neil
3/2/2005 2:09:11 AM
Hi,

I've been using the Trace Session Manager for a while with
an application we run every night. I want the log file to
be written to a network share, but whenever I change the
TraceSessions.config file to point to a network share I
get an error in the event log saying 'The specified path
is invalid'. Of course I have tried several paths, and
pasted the name from the address bar of explorer to make
sure it is correct.

Does anyone know if this is a limitation of the trace
session manager?

TIA,

mikehayt_ NO[at]SPAM online.microsoft.com
3/4/2005 4:34:23 PM
Hi there

Its a limitation of the underlying Windows Event Tracing. This OS level
tracing cant output across the network. (I assume due to speed limitations
compared to writing to a local disk). Im afriad you'll have to log locally
and then move the files.

The attached script can be used to rollover the log files. You could
schedule ("at" command) the script to run daily and either modify it or
schedule a second script to move off the logs to the network disk.

Hope this helps.

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."



--

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
--------------------
| Hi,
|
| I've been using the Trace Session Manager for a while with
| an application we run every night. I want the log file to
| be written to a network share, but whenever I change the
| TraceSessions.config file to point to a network share I
| get an error in the event log saying 'The specified path
| is invalid'. Of course I have tried several paths, and
| pasted the name from the address bar of explorer to make
| sure it is correct.
|
| Does anyone know if this is a limitation of the trace
| session manager?
|
| TIA,
|
| Neil
|
Neil
3/7/2005 12:34:20 AM
Thanks - and thanks for the script.

Neil
[quoted text, click to view]
("Microsoft.EnterpriseInstrumentation.Configuration.TraceSe
tting
[quoted text, click to view]
mikehayt_ NO[at]SPAM online.microsoft.com
3/8/2005 10:05:08 PM
No worries.

--

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
--------------------
| Thanks - and thanks for the script.
|
| Neil
| >-----Original Message-----
| >Hi there
| >
| >Its a limitation of the underlying Windows Event Tracing.
| This OS level
| >tracing cant output across the network. (I assume due to
| speed limitations
| >compared to writing to a local disk). Im afriad you'll
| have to log locally
| >and then move the files.
| >
| >The attached script can be used to rollover the log
| files. You could
| >schedule ("at" command) the script to run daily and
| either modify it or
| >schedule a second script to move off the logs to the
| network disk.
| >
| >Hope this helps.
| >
| >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.TraceSe
| tting
| >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."
| >
| >
| >
| >--
| >
| >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
| >--------------------
| >| Hi,
| >|
| >| I've been using the Trace Session Manager for a while
| with
| >| an application we run every night. I want the log file
| to
| >| be written to a network share, but whenever I change
| the
| >| TraceSessions.config file to point to a network share I
| >| get an error in the event log saying 'The specified
| path
| >| is invalid'. Of course I have tried several paths, and
| >| pasted the name from the address bar of explorer to
| make
| >| sure it is correct.
| >|
| >| Does anyone know if this is a limitation of the trace
| >| session manager?
| >|
| >| TIA,
| >|
| >| Neil
| >|
| >
| >.
| >
|
AddThis Social Bookmark Button