473,324 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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 1360
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ken | last post by:
I would like to start using EventLogTraceListener, and am running into a couple of significant limitations: 1) I have found that there is no way to write EventLog entries with different...
3
by: Joshua Coady | last post by:
Do Trace calls have any impact on performance if Trace is disabled in the config file? Josh
2
by: Richard | last post by:
Hi, I'm having trouble setting up a config file based trace switch & listener. I added an application config file to my console based C# program using the "Add New Application Config File" button...
6
by: Joe Rattz | last post by:
I can get the Trace.Write() to work if I put the code in an aspx.cs file. But, I have a (C#) class called by my aspx.cs code that also has Trace messages, but none of them show up in the Trace...
5
by: who be dat? | last post by:
Hello all. I'm writing an application that is writing trace information that can be viewed in trace.axd. I would like to rename this and use a different name specific to my application. I know...
3
by: Bruno Paquette | last post by:
I have installed visual studio .net and now i started to write the first few examples from the 70-315 book by Kalani. It looks like all server side code that i put between <% %> doesnt process...
9
by: Joe Rattz | last post by:
I can't seem to get to trace.axd. I have turned tracing on in web.config. Here is how I currently have i configured: <trace enabled="true" requestLimit="10" pageOutput="false"...
1
by: Patrick | last post by:
When Tracing in ASP.NET, the IIS process (on IIs5.1) is locking on the Trace file, and I can't read the trace file without restarting the IIS: Even the following does NOT work (how could I fix...
3
by: Arman Sahakyan | last post by:
Hi, I'm an MFC programmer and know little about .NET programming. Now, for some reasons, I'm developing an ASP .NET application... What I need to know is how to output into VS's Output Window...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.