Trace from a service running in web application

Discussion in 'ASP .Net' started by H Branyan, Oct 23, 2003.

  1. H Branyan

    H Branyan Guest

    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
    H Branyan, Oct 23, 2003
    #1
    1. Advertising

  2. H Branyan

    H Branyan Guest

    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.webformsSwitch.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" <> wrote in message
    news:bn8mm6$u8bfo$-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?
    H Branyan, Oct 23, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rukmal Fernando
    Replies:
    4
    Views:
    851
    Richard Grimes [MVP]
    Oct 27, 2003
  2. H Branyan
    Replies:
    2
    Views:
    284
    H Branyan
    Oct 23, 2003
  3. Matthias S.
    Replies:
    1
    Views:
    648
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  4. Jiho Han
    Replies:
    0
    Views:
    516
    Jiho Han
    Aug 22, 2006
  5. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Adding my messages to the trace.axd trace?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    594
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Apr 6, 2007
Loading...

Share This Page