Re: Tracing to text file in production environment (debug="false")

Efran Cobisi <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Organization QBGROUP SpA
Message-ID <[email protected]>
Hello Ben,

The trace approach is the best to follow, in my opinion. To enable
tracing in ASP.NET just use the following directive inside your
web.config file (system.web section):

<trace enabled="true" />

If you need to capture trace data in a custom trace listener, be sure to
set the writeToDiagnosticsTrace attribute (1) of this element to true also.

HTH,

Efran Cobisi
http://www.cobisi.com

References:
1)
http://msdn2.microsoft.com/en-us/library/system.web.configuration.tracesection.writetodiagnosticstrace.aspx


Ben Joyce wrote:
> When I deploy a site into production I set the debug flag to false in
> the Compilation section of web.config.  When I do this the debug.write
> statements I have in my code are ignored so nothing gets written to
> the text files listener I have set up.
>
> I've tried using trace.write instead so I can still get stuff
> outputted to a file when the site is running, but my trace.write
> statements also seem to be ignored.
>
> Is there some further configuration I have to do to enable this?
>
> Cheers,
>
> Ben
>
> ===================================
> This list is hosted by DevelopMentor®  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.