<configuration>
<!-- Register the section handler for the log4net section -->
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<!-- This section contains the log4net configuration settings -->
<log4net debug="true">
<!-- Define the default appender -->
<appender name="PowerFAIDSLogger" type="log4net.Appender.RollingFileAppender,log4net">
<file type="log4net.Util.PatternString" value="%env{ALLUSERSPROFILE}Company NameApp Namedata_integration.log"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Size"/>
<param name="MaxSizeRollBackups" value="10"/>
<param name="MaximumFileSize" value="512KB"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="{%d{MMM-dd-yyyy} ~ %t} %10r %-5p [%x] <%X{diagnostic}> - %m%n"/>
</layout>
</appender>
<appender name="PerformanceLogger" type="log4net.Appender.RollingFileAppender,log4net">
<file type="log4net.Util.PatternString" value="%env{ALLUSERSPROFILE}Company NameApp Nameperformance.log"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Size"/>
<param name="MaxSizeRollBackups" value="10"/>
<param name="MaximumFileSize" value="512KB"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="{%d{MMM-dd-yyyy} ~ %t} %10r %-5p [%x] <%X{DR} %X{NA}> - %m%n"/>
</layout>
</appender>
<appender name="TransactionLogger" type="log4net.Appender.RollingFileAppender,log4net">
<file type="log4net.Util.PatternString" value="%env{ALLUSERSPROFILE}Company NameApp Namedata_integrationTransaction.log"/>
<param name="AppendToFile" value="true"/>
<param name="RollingStyle" value="Size"/>
<param name="MaxSizeRollBackups" value="10"/>
<param name="MaximumFileSize" value="512KB"/>
<param name="StaticLogFileName" value="true"/>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="{%d{MMM-dd-yyyy} ~ %t} %10r %-5p [%x] <%X{DR} %X{NA}> - %m%n"/>
</layout>
</appender>
<!-- Define the email appender -->
<appender name="SMTPAppender" type="log4net.Appender.SMTPAppender">
<param name="To" value="[email protected]"/>
<param name="From" value="[email protected]"/>
<param name="Subject" value="App Name Error Message"/>
<param name="SMTPHost" value="ecogsdf.CompanyName.local"/>
<param name="LocationInfo" value="false"/>
<param name="BufferSize" value="512"/>
<param name="Lossy" value="true"/>
<evaluator type="log4net.spi.LevelEvaluator">
<param name="Threshold" value="WARN"/>
</evaluator>
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"/>
</layout>
</appender>
<!-- Setup the loggers, add the appenders and set the default priority -->
<logger name="PerformanceLogger">
<priority value="ALL"/>
<appender-ref ref="PerformanceLogger"/>
</logger>
<logger name="App NameLogger">
<priority value="WARN"/>
<appender-ref ref="App NameLogger"/>
</logger>
<logger name="TransactionLogger">
<level value="INFO" />
<appender-ref ref="TransactionLogger"/>
</logger>
</log4net>
</configuration>
CODE New Logger().Info("Write some info")
当我称之为上述法典时,它不把任何产出写到数据中。 记录。 但新洛格人。 Error(“某些错误”)进行罚款。
我赞赏您的支持。