NLOG配置 - 如何在化合物中使用布局变量?
在我的nlog配置中,我有一个可容纳我的jsonlayout的变量:
<variable name="jsonLayoutv0.1">
<layout type="JsonLayout">
<attribute name="time" layout="${longdate}" />
</layout>
</variable>
然后,我想将此布局放在稍后在我的nlog配置中的复合layout中,而无需重新编写整个jsonlayout:
<sl:layout xsi:type="CompoundLayout">
<layout xsi:type="SimpleLayout" text="@cee: " />
<INSERT HERE/>
</sl:layout>
我该如何使用可用的变量。在复合层中?
In my NLog Config I have a variable to hold my JsonLayout:
<variable name="jsonLayoutv0.1">
<layout type="JsonLayout">
<attribute name="time" layout="${longdate}" />
</layout>
</variable>
I then want to place this layout inside a compoundLayout later on in my NLog config without having to re-write the whole jsonLayout again:
<sl:layout xsi:type="CompoundLayout">
<layout xsi:type="SimpleLayout" text="@cee: " />
<INSERT HERE/>
</sl:layout>
How can I go about re-using the variable inside a CompoundLayout?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NLOG 5.0.1现在可用: https://www.nuget.orget.orget.org/packages/ nlog/5.0.1 您可以做到这一点:
另请参阅: https:// github.com/nlog/nlog/pull/4940
NLog 5.0.1 is now available: https://www.nuget.org/packages/NLog/5.0.1 so you can do this:
See also: https://github.com/NLog/NLog/pull/4940