Mini
Mini

Reputation: 157

Trace output not getting logged in output file at times

I'm using TextWriterTraceListener to log error messages to a text file.The TraceOutputFile has been mentioned in the web.config file as "trace.log.txt". The error messages are getting logged to the trace.log.txt. But at times I notice that some files are getting generated randomly under root folder with the exception details instead of logging to the trace.log.txt.

This is not happening in any particular page and hence I am unable to detect the reason as to why these files are getting generated.Ex:14dbc20a-9eb8-4fec-b6bd-54400db2ceatrace.log.txt .

Can u suggest me any circumstances when this might happen?

Upvotes: 0

Views: 345

Answers (2)

Sergey Baranchenkov
Sergey Baranchenkov

Reputation: 624

if you are familiar with ETW tracing, you could register EventProviderTraceListener instead of TextWriterTraceListener. You could details how to do that here.

Upvotes: 1

serialhobbyist
serialhobbyist

Reputation: 4815

I saw something similar when I had two threads trying to write to the log file at the same time whilst using the Enterprise Library logging classes.

Upvotes: 0

Related Questions