vb.net - Using Microsoft.VisualBasic.Logging.FileLogTraceListener with .NET v 1.0 -
i have application in .net 1.0 logs using system.diagnostics.textwritertracelistener
below service.exe.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <runtime> <legacyunhandledexceptionpolicy enabled="1" /> </runtime> <system.diagnostics> <trace autoflush="false" indentsize="4"> <listeners> <add name="mylistener" type="system.diagnostics.textwritertracelistener" initializedata="service.log" /> </listeners> </trace> </system.diagnostics> </configuration>
this configuration creating huge log file , not rolling file, after research found below configuration using microsoft.visualbasic.logging.filelogtracelistener
rollover log file daily
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <legacyunhandledexceptionpolicy enabled="1"/> </runtime> <system.diagnostics> <trace autoflush="true" indentsize="4"/> <sources> <source name="log" switchvalue="all"> <listeners> <add name="file" type="microsoft.visualbasic.logging.filelogtracelistener, microsoft.visualbasic, version=7.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" basefilename="service_daily.txt" diskspaceexhaustedbehavior="throwexception" location="executabledirectory" maxfilesize="81920000" logfilecreationschedule="daily"/> </listeners> </source> </sources> </system.diagnostics> </configuration>
after changing config microsoft.visualbasic.logging.filelogtracelistener
application starts fine not creating log file service_daily.txt
can me create rolling log file using microsoft.visualbasic.logging.filelogtracelistener .net v 1.0
Comments
Post a Comment