473,396 Members | 1,666 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,396 software developers and data experts.

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

Similar topics

1
by: Sean Walker | last post by:
I have installed the Microsoft Enterprise Instrumentation framework and have installed the samples. I have events successfully being logged to the Application Event Log using the Simple...
2
by: H Branyan | last post by:
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...
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...
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...
0
by: orencs | last post by:
Hi I am using IIS6 on Windows Server 2003. I am trying to write to the trace log via Web Service but fails. System.Diagnostics.Trace.WriteLine("some message"); I am using DebugView to see the...
8
by: Bryan | last post by:
Does anyone have an example of an application that can connect to a running process and capture Trace.WriteLine calls like in SQL Server Profiler? I know that we can inherit from a TraceListener...
1
by: Tris | last post by:
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...
3
by: Eternal | last post by:
Hello there, I am working on an service that uses Trace.writeline(....) to log its activities. My question is, is there any way to clear this log while the application is still running. My service...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.