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. Advertisements

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:
    1,066
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    835
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Mohit Mehral
    Replies:
    3
    Views:
    1,444
    Nigel Wade
    Mar 24, 2006
  4. =?Utf-8?B?U2FsZW5h?=

    Save data from text file into access

    =?Utf-8?B?U2FsZW5h?=, Aug 5, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    427
    =?Utf-8?B?U2FsZW5h?=
    Aug 5, 2006
  5. Grant Schenck
    Replies:
    0
    Views:
    871
    Grant Schenck
    Mar 29, 2007
  6. Alexander Wolff

    save generic asp.net trace information to file

    Alexander Wolff, Apr 18, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    457
    Teemu Keiski
    Apr 19, 2008
  7. Chris Newby
    Replies:
    0
    Views:
    994
    Chris Newby
    Jul 28, 2008
  8. Replies:
    5
    Views:
    476
Loading...