469,963 Members | 2,188 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Trace from a service running in web application

In the Application_OnStart event in global.asax, my code calls an
AlertService which creates a System.Timers.Timer() object. So this service
doesn't actually run in conjunction with a specific aspx page, apparently.
When the timer's Elapsed event handler fires, it calls some other classes I
have written. These classes output some Trace statements that you can view
if an aspx page calls them, but I can't seem to figure out where the Trace
statements go when my service calls the classes.

Is there any way I can find the trace for this service?
--
[[((hillarie))]]

To reply, remove ".SPAMBLOCK" from email address
Nov 17 '05 #1
1 1374
Doing some research, I've come across the System.Diagnostics tools. I have
set up my application to write to a textfile, c:\listener.log, but while the
file was automatically created, I am not able to write to the file.

code...

web.config:

<system.diagnostics>
<switches>
<add name="tracewebforms" value="1" />
<add name="tracebusinesslogic" value="1" />
</switches>
<trace autoflush="true" >
<listeners>
<add name="ImplicitListener"
type="System.Diagnostics.TextWriterTraceListener, System,
Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
initializeData="c:\TraceListener.log"/>
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>

<compilation defaultLanguage="c#" debug="true">
<compilers>
<compiler
language="C#;Csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.3300.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
compilerOptions="/d:TRACE" />
</compilers>
</compilation>

Page_load event of webform:

System.Diagnostics.Trace.WriteLineIf(Global.webfor msSwitch.Enabled,"Trace
From WebForms");
What could prevent the WriteLineIf from actually writing to the file?

--
[[((hillarie))]]

To reply, remove ".SPAMBLOCK" from email address

"H Branyan" <hb****************@merc.mercer.edu> wrote in message
news:bn************@ID-92475.news.uni-berlin.de...
In the Application_OnStart event in global.asax, my code calls an
AlertService which creates a System.Timers.Timer() object. So this service doesn't actually run in conjunction with a specific aspx page, apparently.
When the timer's Elapsed event handler fires, it calls some other classes I have written. These classes output some Trace statements that you can view if an aspx page calls them, but I can't seem to figure out where the Trace
statements go when my service calls the classes.

Is there any way I can find the trace for this service?

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by H Branyan | last post: by
9 posts views Thread by Joe Rattz | last post: by
reply views Thread by orencs | last post: by
8 posts views Thread by Bryan | last post: by
1 post views Thread by Tris | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.