Socket报文和端口测试工具的开发
作者:网络转载 发布时间:[ 2013/11/22 15:54:32 ] 推荐标签:
客户端的报文和服务器端的报文数据存放在Client.log和Server.log两个文件当中.主要是借助了Log4net的配置实现的.
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="RollingFileAppender" />
</root>
<appender name="ClientLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="client.log"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="3" />
<maximumFileSize value="2MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="记录时间:%date 日志:%message%newline" />
</layout>
</appender>
<logger name="SocketTool.ClientForm">
<level value="DEBUG" />
<appender-ref ref="ClientLogFileAppender" />
</logger>
<appender name="ServerLogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="server.log"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="3" />
<maximumFileSize value="2MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="记录时间:%date 日志:%message%newline" />
</layout>
</appender>
<logger name="SocketTool.ServerForm">
<level value="DEBUG" />
<appender-ref ref="ServerLogFileAppender" />
</logger>
</log4net>
|
本文内容不用于商业目的,如涉及知识产权问题,请权利人联系SPASVO小编(021-61079698-8054),我们将立即处理,马上删除。