how to save trace output into text file

Discussion in 'ASP .Net' started by IK, Jan 16, 2004.

  1. IK

    IK Guest

    Hi all,

    How can I save trace output to the text file in app's dir. In addition, I
    need to save debug info from Session_End event in global.asax.
    The code below saves file only in Windows\System32 dir.
    TextWriterTraceListener tracer = new
    TextWriterTraceListener("traceout.txt");
    Trace.Listeners.Add(tracer);
    Trace.WriteLine("Exception"+ex.Message);
    tracer.Dispose();

    When I try to open file in apps folder I get error message "access denied to
    the file ..."

    Thanks a lot,
    IK
    IK, Jan 16, 2004
    #1
    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:
    839
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    635
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Jiho Han
    Replies:
    0
    Views:
    506
    Jiho Han
    Aug 22, 2006
  4. Grant Schenck
    Replies:
    0
    Views:
    671
    Grant Schenck
    Mar 29, 2007
  5. Chris Newby
    Replies:
    0
    Views:
    758
    Chris Newby
    Jul 28, 2008
Loading...

Share This Page