Trace from a service running in web application

H

H Branyan

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?
 
N

Natty Gur

Hi,

You can't use TraceContext from class that is not part of page request
process since trace can be use from Context only. you can use diagnostic
(namespace) trace class to write to variety of outputs.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
H

H Branyan

Hi Natty - I have found some tutorials on the System.Diagnostics namespace
but I am unable to write to a log file. I posted a followup to my original
post asking for more info on my problem. Thank you for your reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top