-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NLog schema, XSD won't work for new FilteringWrapper syntax #3473
Comments
There is only support for one filter. So one cannot have two <target xsi:type="FilteringWrapper" name="default" >
<filter xsi:type="whenRepeated" layout="${message}" timeoutSeconds="30" action="Ignore" />
<filter xsi:type="when"/> Strange that it doesn't inherit |
It does! But combining target + condition gives a xsd error |
Would be nice to fix that also. Anyway, needs docs on wiki I guess (or I missed that) |
There is already: https://github.com/NLog/NLog/wiki/PostFilteringWrapper-target (For those with crazy desires for very advanced filtering) |
Not super skilled with MakeNLogXSD. But maybe this will improve the output: #3474 |
note: to fix (disallow it 2nd filter) <target xsi:type="FilteringWrapper" name="default" >
<filter xsi:type="whenRepeated" layout="${message}" timeoutSeconds="30" action="Ignore" />
<filter xsi:type="when"/>
</target>
we need: <xs:complexType name="FilteringWrapper">
<xs:complexContent>
<xs:extension base="WrapperTargetBase">
<xs:choice minOccurs="0" maxOccurs="1"> <!-- maxOccurs changed to 1, was unbounded -->
<xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" />
<xs:element name="filter" minOccurs="0" maxOccurs="1" type="Filter" />
<xs:element name="optimizeBufferReuse" minOccurs="0" maxOccurs="1" type="xs:boolean" />
</xs:choice> but I'am afraid this won't count for all elements. Also those elements as "optimizeBufferReuse" are a bit strange (those are also as attribute) - not sure if that's correct |
note, this works: <target xsi:type="FilteringWrapper" name="default" >
<target xsi:type="Console" />
<filter xsi:type="whenRepeated" layout="${message}" timeoutSeconds="30" action="Ignore" />
</target> first target, then filter. |
related #3472
after fix, then:
works (no XSD errors):
works:
not working
The issue is that in the XSD, it's a "choice":
The text was updated successfully, but these errors were encountered: