由网友(随你所喜)分享简介:在我的ASP.NET MVC项目中,我在Web.config中有如下配置:![关于 善林案 被害人信息登记核对平台使用的相关说明](https://p.xsw88.cn/allimgs/daicuo/20230903/3886.png)
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="default" xsi:type="File" fileName="logs/app-log.txt" layout="
--------------------- ${level} (${longdate}) ----------------------$
IP: ${aspnet-request-ip}
Call Site: ${callsite}
${level} message: ${message}"/> archiveFileName="logs/archives/app-log.{#}.txt" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="7" />
</targets>
<rules>
<logger name="*" writeTo="default" />
</rules>
</nlog>
如果我的日志消息是波斯文本,则在日志文件中我会将问号标记为?????
,而不是波斯文本。
如何解决此问题?如有任何帮助,将不胜感激!
推荐答案
![关于 善林案 被害人信息登记核对平台使用的相关说明](https://p.xsw88.cn/allimgs/daicuo/20230903/3886.png)
我在目标元素中添加了encoding="UTF8"
属性
相关推荐
最新文章