nlog.config一段时间后不编写日志
我正在遇到NLOG的问题,没有将日志写入配置文件中提到的文件夹。这是针对我们实施的Windows服务。每当我们启动服务时,它都会写几天/小时的日志。但是突然间,它停止写日志。我们再次需要重新启动服务以解决该问题,并再次重复问题。
请在下面找到NLOG配置文件,并真正感谢任何解决问题的帮助。
<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<targets async="true">
<target name="ApplicationLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\account.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\account.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
<target name="securityLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\securityLog.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\securityLog.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="securityLog" />
<logger name="*" minlevel="Info" writeTo="ApplicationLog" />
</rules>
</nlog>
谢谢
I am having an issue with Nlog not writing logs to the folder mentioned in the config file. This is for windows service we implemented. Whenever we start a service, it writes the logs for few days/hours. But all off a sudden it stops writing the logs. We again needs to restart the service to resolve the issue and issues repeats again.
Please find below the nlog config file and any help to resolve the issue is really appreciated.
<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<targets async="true">
<target name="ApplicationLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\account.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\account.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
<target name="securityLog" xsi:type="File" layout="<LogEntry><Date>${longdate}</Date><Level>${level}</Level><Message>${message}</Message><StackDump>${stacktrace}</StackDump><Exception>${exception:format=ToString}</Exception></LogEntry>" fileName="D:\ApplicationLogs\Account\securityLog.txt" encoding="iso-8859-2" archiveFileName="D:\ApplicationLogs\Account\Archive\securityLog.{########}.txt" archiveNumbering="Rolling" archiveEvery="Day" archiveAboveSize="20971520" maxArchiveFiles="60" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="securityLog" />
<logger name="*" minlevel="Info" writeTo="ApplicationLog" />
</rules>
</nlog>
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论