my.application.log
Since the post above,
I am trying to use the exe assembly app.config to log database changes. it works, but I have 3 questions,
1. can i use filter to tell if log entry type is INFORMATION, then go to one custom file log, if it is ERROR, then go to another custom file log?
2. Is it possible to have a centralized file log (ie, file log in a network share)? the problem I am having now is when you have more than one application instance running either on one computer or on more than one computer at the same time, more than one log will be created. (ie, application.log, application-1.log ...)
3. How to diable the application data folder file log? My problem is my application will not only create a custom file log I want, but also create a file log in application data folder. (ie. C:\Documents and Settings\Administrator\Application Data\...) <
<sources>
<!-- This section defines the logging configuration for My.Application.Log-->
<sourcename="DefaultSource"switchName="DefaultSwitch">
<listeners>
<addname="FileLog"/>
<!-- Uncomment the below section to write to the Application Event Log-->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources>
<switches>
<addname="DefaultSwitch"value="Information" />
</switches>
<sharedListeners>
<addname="FileLog"
type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"initializeData="FileLogWriter"location="Custom"customlocation="F:\HCP\log" ></
add><!--
Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log--><!--
<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="HCP CaseManagement"/>--></
sharedListeners></
system.diagnostics>
