Objective
Use System.Diagnostics
to perform tracing. Though I have used log4net
and other logging solutions, I am only interested in getting tracing to work with System.Diagnostics
.
Problem
Even though I'm issuing the TraceEvent
the file is not being created anywhere.
Application Information
I have an application that's hosting some WF services. One of the services is a state machine with an initial state that looks like this:
the LogMessage
custom activity is also very straight forward. It receives four basic parameters:
defines the TraceSource
as a variable:
and then simply calls TraceEvent
:
Configuration
The configuration for this TraceSource
and TraceListener
is as follows:
<system.diagnostics>
<trace autoflush="true"/>
<sources>
<source name="log" switchValue="All">
<listeners>
<add name="file" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
BaseFileName="gsf_workflows.txt"
DiskSpaceExhaustedBehavior="ThrowException"
Location="Custom"
CustomLocation="D:Log"
MaxFileSize="81920000"
LogFileCreationSchedule="LogFileCreationScheduleOption.Daily"/>
</listeners>
</source>
</sources>
</system.diagnostics>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…