我使用RollingFileAppender进行登录到一个conversionPattern一个文件中的一些信息(在web.config)看起来像这样为每个日志节的标题:Log4net可以有多个appender写入同一个文件吗?
<conversionPattern value="%date - %property{userId} - %property{method}%newline--------------------------------%newline%message%newline%newline"/>
我想登录在这个标题下的细节作为项目符号。我目前正试图用另一种RollingFileAppender进行,它记录到同一文件只是一个破折号的简单conversionPattern,就像这样:
<conversionPattern value="- %message%newline"/>
但这些消息不会使它到日志文件。我使用Log.Info()作为标题,使用Log.Debug()作为项目符号点,并在各自的日志级别上筛选每个appender。我正在尝试做什么?或者是否有更好的方法将标题和详细信息从log4net中获取到日志文件中?
注意只有最新版本的log4net有这个lockingModel Xml设置和MinimalLock类如果你使用旧版本,没有错误会抛出,但它不会工作。 – 2015-01-05 09:34:37