c# - TextWriterTraceListener does not work -


config file:

  <system.diagnostics>     <trace>       <listeners>         <add name="console" type="system.diagnostics.consoletracelistener" initializedata="false"></add>         <add name="text" type="system.diagnostics.textwritertracelistener" initializedata="d:\uat\logs\bifit.log" traceoutputoptions="datetime"></add>       </listeners>     </trace>   </system.diagnostics> 

the code:

  static void main(string[] args)         {             try             {                 trace.writeline("running bifit test server.");              }          } 

i can see text in cosole window. , file created, empty. remember there autoflush property somewhere?

you recall correctly - defined on trace element:

<trace autoflush="true">   ... </trace> 

autoflush - optional attribute. specifies whether trace listeners automatically flush output buffer after every write operation.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -