469,919 Members | 2,170 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,919 developers. It's quick & easy.

VB ASP Trace Outputed to File

I've got a web service running, and i'm trying to build tracing into it that
is outputted to a file. Unfortunately, i can't find a way of enabling TRACE
token, and it just seems to skip over all System.Diagnostics.Trace lines in
the debugger.
I don't want to use the ASP page trace dump, as it will break my SOAP
interface.

This code is called on my application start event:
Dim lstrFileStream As System.IO.FileStream
Dim objTraceListener As System.Diagnostics.TraceListener

'Create Stream and Listener
lstrFileStream = New System.IO.FileStream("C:\Temp\Tracer.Log",
IO.FileMode.OpenOrCreate)
objTraceListener = New
System.Diagnostics.TextWriterTraceListener(lstrFil eStream)
objTraceListener.TraceOutputOptions = Diagnostics.TraceOptions.Timestamp

'Trace Item
System.Diagnostics.Trace.Listeners.Add(objTraceLis tener)

This is called at the start of one of the SOAP requests:
System.Diagnostics.Trace.Write("Add Account Called.")
System.Diagnostics.Trace.Flush()
This generates an empty file, and never writes anything too it.

While i am aware that this style of trace listener may not be ideal, i'd be
happy with it writing anything right now.

Any thoughts?

Cheers Chaps

Tris
Aug 22 '06 #1
1 1235
you may need this in your web.config

<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
compilerOptions="/d:TRACE" type="Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel="1"/>
<compiler language="VB" extension=".vb"
compilerOptions="/d:Trace=true" type="Microsoft.VisualBasic.VBCodeProvider,
System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</compilers>
</system.codedom>
HTHs
"Tris" wrote:
I've got a web service running, and i'm trying to build tracing into it that
is outputted to a file. Unfortunately, i can't find a way of enabling TRACE
token, and it just seems to skip over all System.Diagnostics.Trace lines in
the debugger.
I don't want to use the ASP page trace dump, as it will break my SOAP
interface.

This code is called on my application start event:
Dim lstrFileStream As System.IO.FileStream
Dim objTraceListener As System.Diagnostics.TraceListener

'Create Stream and Listener
lstrFileStream = New System.IO.FileStream("C:\Temp\Tracer.Log",
IO.FileMode.OpenOrCreate)
objTraceListener = New
System.Diagnostics.TextWriterTraceListener(lstrFil eStream)
objTraceListener.TraceOutputOptions = Diagnostics.TraceOptions.Timestamp

'Trace Item
System.Diagnostics.Trace.Listeners.Add(objTraceLis tener)

This is called at the start of one of the SOAP requests:
System.Diagnostics.Trace.Write("Add Account Called.")
System.Diagnostics.Trace.Flush()
This generates an empty file, and never writes anything too it.

While i am aware that this style of trace listener may not be ideal, i'd be
happy with it writing anything right now.

Any thoughts?

Cheers Chaps

Tris
Aug 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Joshua Coady | last post: by
2 posts views Thread by Richard | last post: by
6 posts views Thread by Joe Rattz | last post: by
3 posts views Thread by Bruno Paquette | last post: by
9 posts views Thread by Joe Rattz | last post: by
3 posts views Thread by Arman Sahakyan | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.