Skip to content
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 XSD schema broken #3472

Closed
304NotModified opened this issue Jun 11, 2019 · 9 comments · Fixed by #3476
Closed

NLog XSD schema broken #3472

304NotModified opened this issue Jun 11, 2019 · 9 comments · Fixed by #3476
Assignees
Labels
bug Bug report / Bug fix XSD change
Milestone

Comments

@304NotModified
Copy link
Member

304NotModified commented Jun 11, 2019

Warning Type 'http://www.nlog-project.org/schemas/NLog.xsd:Filter' is not declared, or is not a simple type.

image

Seems to be broken with NLog 4.6.4 (4.6.3 is OK)

broken with NLog/NLog.github.io@febd452

@304NotModified 304NotModified added this to the 4.6.5 milestone Jun 11, 2019
@304NotModified 304NotModified added bug Bug report / Bug fix XSD change labels Jun 11, 2019
@304NotModified 304NotModified changed the title NLog schema broken NLog XSD schema broken Jun 11, 2019
@304NotModified
Copy link
Member Author

304NotModified commented Jun 11, 2019

Issue:

  <xs:attribute name="filter" type="Filter">
          <xs:annotation>
            <xs:documentation>Filter. Log events who evaluates to  will be discarded</xs:documentation>
          </xs:annotation>
        </xs:attribute>

inside

  <xs:complexType name="FilteringWrapper">
    <xs:complexContent>
      <xs:extension base="WrapperTargetBase">
        <xs:choice minOccurs="0" maxOccurs="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>
        <xs:attribute name="name" type="xs:string">
          <xs:annotation>
            <xs:documentation>Name of the target.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="condition" type="Condition">
          <xs:annotation>
            <xs:documentation>Condition expression. Log events who meet this condition will be forwarded to the wrapped target.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="filter" type="Filter">
          <xs:annotation>
            <xs:documentation>Filter. Log events who evaluates to  will be discarded</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="optimizeBufferReuse" type="xs:boolean">
          <xs:annotation>
            <xs:documentation>Target supports reuse of internal buffers, and doesn't have to constantly allocate new buffers Required for legacy NLog-targets, that expects buffers to remain stable after Write-method exit</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>

@304NotModified
Copy link
Member Author

This is not from the template (NLog/tools/MakeNLogXSD/TemplateXSD.xml)

@304NotModified
Copy link
Member Author

filter isn't an attribute, but not sure why it generated like that

@304NotModified
Copy link
Member Author

  <xs:attribute name="filter" type="Filter">
          <xs:annotation>
            <xs:documentation>Filter. Log events who evaluates to  will be discarded</xs:documentation>
          </xs:annotation>
        </xs:attribute>

needs to be removed, as we have already the child element:

          <xs:element name="filter" minOccurs="0" maxOccurs="1" type="Filter" />

@304NotModified
Copy link
Member Author

found another issue -> #3473

@304NotModified
Copy link
Member Author

@304NotModified
Copy link
Member Author

tools/MakeNLogXSD/XsdFileGenerator.cs of dfd3845 could be the issue

@304NotModified
Copy link
Member Author

304NotModified commented Jun 11, 2019

[NLogConfigurationIgnorePropertyAttribute] for FilteringTargetWrapper.Filter could be a solution , but not sure what side effects that has (used in ObjectGraphScanner)

@snakefoot
Copy link
Contributor

snakefoot commented Jun 11, 2019

tools/MakeNLogXSD/XsdFileGenerator.cs of dfd3845 could be the issue

Not super skilled with MakeNLogXSD. But maybe this will improve the output: #3474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report / Bug fix XSD change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants