将 r\n 替换为 exception:format=@ 中的 \n
Replace r\n with \n in exception:format=@
当我在 nlog 配置中使用它时:
<attribute name="Exception" encode="false" layout="${exception:format=@}"/>
json 字符串包括“\r\n”。我怎样才能用“\n”替换它?
非常感谢!
贡纳尔
你试过用这个吗:
${replace:searchFor=\\r\\n:replaceWith=\\n:inner=${exception:format=@}}
另请参阅:https://github.com/nlog/NLog/wiki/Replace-Layout-Renderer
当我在 nlog 配置中使用它时:
<attribute name="Exception" encode="false" layout="${exception:format=@}"/>
json 字符串包括“\r\n”。我怎样才能用“\n”替换它?
非常感谢! 贡纳尔
你试过用这个吗:
${replace:searchFor=\\r\\n:replaceWith=\\n:inner=${exception:format=@}}
另请参阅:https://github.com/nlog/NLog/wiki/Replace-Layout-Renderer