Skip to content

Commit 6f2e794

Browse files
committed
some samples for log4j scanning
1 parent 3188e2a commit 6f2e794

File tree

2,241 files changed

+459656
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,241 files changed

+459656
-0
lines changed
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://logging.apache.org/log4j/2.0/config" targetNamespace="http://logging.apache.org/log4j/2.0/config" elementFormDefault="qualified" attributeFormDefault="unqualified">
20+
<xs:element name="Configuration" type="ConfigurationType"/>
21+
<xs:complexType name="ConfigurationType">
22+
<xs:sequence>
23+
<xs:choice minOccurs="0" maxOccurs="1">
24+
<xs:element name="CustomLevels" type="CustomLevelsType"/>
25+
<xs:element name="CustomLevel" type="CustomLevelType"/>
26+
</xs:choice>
27+
<xs:element name="Properties" type="PropertiesType" minOccurs="0"/>
28+
<xs:choice minOccurs="0" maxOccurs="1">
29+
<xs:element name="Filters" type="FiltersType"/>
30+
<xs:element name="Filter" type="FilterType"/>
31+
</xs:choice>
32+
<xs:element name="ThresholdFilter" type="ThresholdFilterType" minOccurs="0"/>
33+
<xs:element name="Appenders" type="AppendersType"/>
34+
<xs:element name="Loggers" type="LoggersType"/>
35+
</xs:sequence>
36+
<xs:attribute name="packages" type="xs:string"/>
37+
<xs:attribute name="status" type="xs:string"/>
38+
<xs:attribute name="strict" type="xs:string"/>
39+
<xs:attribute name="name" type="xs:string"/>
40+
<xs:attribute name="advertiser" type="xs:string"/>
41+
<xs:attribute name="shutdownTimeout" type="xs:string" use="optional"/>
42+
<xs:attribute name="schema" type="xs:string"/>
43+
</xs:complexType>
44+
<xs:complexType name="PropertiesType">
45+
<xs:sequence>
46+
<xs:element name="Property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
47+
</xs:sequence>
48+
</xs:complexType>
49+
<xs:complexType name="AppenderType">
50+
<xs:sequence>
51+
<xs:element name="Layout" type="LayoutType" minOccurs="0"/>
52+
<xs:choice minOccurs="0" maxOccurs="1">
53+
<xs:element name="Filters" type="FiltersType"/>
54+
<xs:element name="Filter" type="FilterType"/>
55+
</xs:choice>
56+
</xs:sequence>
57+
<xs:attribute name="type" type="xs:string" use="required"/>
58+
<xs:attribute name="name" type="xs:string" use="required"/>
59+
<xs:attribute name="fileName" type="xs:string" use="optional"/>
60+
</xs:complexType>
61+
<xs:complexType name="RootType">
62+
<xs:sequence>
63+
<xs:element name="AppenderRef" type="AppenderRefType" minOccurs="1" maxOccurs="unbounded"/>
64+
</xs:sequence>
65+
<xs:attribute name="level" type="xs:string"/>
66+
</xs:complexType>
67+
<xs:complexType name="PropertyType">
68+
<xs:simpleContent>
69+
<xs:extension base="xs:string">
70+
<xs:attribute name="name" type="xs:string"/>
71+
</xs:extension>
72+
</xs:simpleContent>
73+
</xs:complexType>
74+
<xs:complexType name="KeyValuePairType">
75+
<xs:simpleContent>
76+
<xs:extension base="xs:string">
77+
<xs:attribute name="key" type="xs:string"/>
78+
<xs:attribute name="value" type="xs:string"/>
79+
</xs:extension>
80+
</xs:simpleContent>
81+
</xs:complexType>
82+
<xs:complexType name="AppendersType">
83+
<xs:sequence>
84+
<xs:element name="Appender" type="AppenderType" minOccurs="0" maxOccurs="unbounded"/>
85+
<xs:element name="Console" type="ConsoleType" minOccurs="0"/>
86+
</xs:sequence>
87+
</xs:complexType>
88+
<xs:complexType name="ConsoleType">
89+
<xs:sequence>
90+
<xs:element name="PatternLayout" type="PatternLayoutType" minOccurs="1" maxOccurs="unbounded"/>
91+
</xs:sequence>
92+
<xs:attribute type="xs:string" name="name" use="required"/>
93+
<xs:attribute type="xs:string" name="target" use="required"/>
94+
<xs:attribute type="xs:string" name="follow" use="optional"/>
95+
</xs:complexType>
96+
<xs:complexType name="PatternLayoutType">
97+
<xs:simpleContent>
98+
<xs:extension base="xs:string">
99+
<xs:attribute type="xs:string" name="pattern" use="required"/>
100+
</xs:extension>
101+
</xs:simpleContent>
102+
</xs:complexType>
103+
<xs:complexType name="AppenderRefType">
104+
<xs:simpleContent>
105+
<xs:extension base="xs:string">
106+
<xs:attribute name="ref" type="xs:string" use="required"/>
107+
</xs:extension>
108+
</xs:simpleContent>
109+
</xs:complexType>
110+
<xs:complexType name="LoggerType">
111+
<xs:sequence>
112+
<xs:choice minOccurs="0" maxOccurs="1">
113+
<xs:element name="Filters" type="FiltersType"/>
114+
<xs:element name="Filter" type="FilterType"/>
115+
</xs:choice>
116+
<xs:element name="AppenderRef" type="AppenderRefType" minOccurs="0" maxOccurs="unbounded"/>
117+
</xs:sequence>
118+
<xs:attribute name="name" type="xs:string" use="required"/>
119+
<xs:attribute name="level" type="xs:string" use="optional"/>
120+
<xs:attribute name="additivity" type="xs:string" use="optional"/>
121+
</xs:complexType>
122+
<xs:complexType name="FilterType" mixed="true">
123+
<xs:sequence>
124+
<xs:element name="KeyValuePair" type="KeyValuePairType" minOccurs="0"/>
125+
</xs:sequence>
126+
<xs:attribute name="type" type="xs:string" use="required"/>
127+
<xs:attribute name="level" type="xs:string" use="optional"/>
128+
<xs:attribute name="marker" type="xs:string" use="optional"/>
129+
<xs:attribute name="onMatch" type="xs:string" use="optional"/>
130+
<xs:attribute name="onMismatch" type="xs:string" use="optional"/>
131+
</xs:complexType>
132+
<xs:complexType name="FiltersType">
133+
<xs:sequence>
134+
<xs:element name="Filter" type="FilterType" minOccurs="0" maxOccurs="unbounded"/>
135+
</xs:sequence>
136+
</xs:complexType>
137+
<xs:complexType name="CustomLevelType">
138+
<xs:attribute name="name" type="xs:string" use="required"/>
139+
<xs:attribute name="intLevel" type="xs:string" use="required"/>
140+
</xs:complexType>
141+
<xs:complexType name="CustomLevelsType">
142+
<xs:sequence>
143+
<xs:element name="CustomLevel" type="CustomLevelType" minOccurs="0" maxOccurs="unbounded"/>
144+
</xs:sequence>
145+
</xs:complexType>
146+
<xs:complexType name="LoggersType" mixed="true">
147+
<xs:sequence>
148+
<xs:element name="Logger" type="LoggerType" minOccurs="0" maxOccurs="unbounded"/>
149+
<xs:element name="Root" type="RootType" minOccurs="1" maxOccurs="1"/>
150+
</xs:sequence>
151+
</xs:complexType>
152+
<xs:complexType name="LayoutType" mixed="true">
153+
<xs:sequence>
154+
<xs:element name="Pattern" type="xs:string" minOccurs="0"/>
155+
</xs:sequence>
156+
<xs:attribute name="type" type="xs:string" use="required"/>
157+
<xs:attribute name="pattern" type="xs:string" use="optional"/>
158+
</xs:complexType>
159+
<xs:complexType name="ThresholdFilterType">
160+
<xs:attribute name="level" type="xs:string" use="optional"/>
161+
<xs:attribute name="onMatch" type="xs:string" use="optional"/>
162+
<xs:attribute name="onMismatch" type="xs:string" use="optional"/>
163+
</xs:complexType>
164+
</xs:schema>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<!--the entity declarations may be overridden in the internal subset-->
19+
<!--namespace prefixes-->
20+
<!ENTITY % log4j_prefix "log4j">
21+
<!--namespace prefix to namespace uri mappings-->
22+
<!ENTITY % log4j_prefix.. "%log4j_prefix;:">
23+
<!--namespaces attributes for root element-->
24+
<!ENTITY % documentElementAttributes " xmlns:%log4j_prefix; CDATA 'http://logging.apache.org/log4j/2.0/events'">
25+
<!--the declarations below should not be modified-->
26+
<!--element name mappings-->
27+
<!ENTITY % log4j..Events "%log4j_prefix..;Events">
28+
<!ENTITY % log4j..Event "%log4j_prefix..;Event">
29+
<!ENTITY % log4j..Message "%log4j_prefix..;Message">
30+
<!ENTITY % log4j..Marker "%log4j_prefix..;Marker">
31+
<!ATTLIST %log4j..Marker;
32+
parent CDATA #IMPLIED
33+
>
34+
<!ENTITY % log4j..NDC "%log4j_prefix..;NDC">
35+
<!ENTITY % log4j..Throwable "%log4j_prefix..;Throwable">
36+
<!ENTITY % log4j..LocationInfo "%log4j_prefix..;LocationInfo">
37+
<!ENTITY % log4j..Properties "%log4j_prefix..;Properties">
38+
<!ENTITY % log4j..Data "%log4j_prefix..;Data">
39+
<!--element and attribute declarations-->
40+
<!--Log4J 2.0 XML Schema-->
41+
<!ELEMENT %log4j..Events; ((%log4j..Event;)*)>
42+
<!ATTLIST %log4j..Events;
43+
%documentElementAttributes;
44+
>
45+
<!ELEMENT %log4j..Event; (%log4j..Message;, (%log4j..NDC;)?, (%log4j..Marker;)?, (%log4j..Throwable;)?, (%log4j..LocationInfo;)?, (%log4j..Properties;)?)>
46+
<!ATTLIST %log4j..Event;
47+
logger CDATA #REQUIRED
48+
timestamp NMTOKEN #REQUIRED
49+
level (OFF | FATAL | ERROR | WARN | INFO | DEBUG | TRACE | ALL) #REQUIRED
50+
threadId CDATA #REQUIRED
51+
thread CDATA #REQUIRED
52+
threadPriority CDATA #REQUIRED
53+
>
54+
<!ELEMENT %log4j..Message; ANY>
55+
<!ELEMENT %log4j..NDC; ANY>
56+
<!ELEMENT %log4j..Throwable; ANY>
57+
<!ELEMENT %log4j..LocationInfo; EMPTY>
58+
<!ATTLIST %log4j..LocationInfo;
59+
class CDATA #REQUIRED
60+
method CDATA #REQUIRED
61+
file CDATA #REQUIRED
62+
line NMTOKEN #REQUIRED
63+
>
64+
<!ELEMENT %log4j..Properties; ((%log4j..Data;)+)>
65+
<!ELEMENT %log4j..Data; EMPTY>
66+
<!ATTLIST %log4j..Data;
67+
name CDATA #REQUIRED
68+
value CDATA #REQUIRED
69+
>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:log4j="http://logging.apache.org/log4j/2.0/events" targetNamespace="http://logging.apache.org/log4j/2.0/events" elementFormDefault="qualified" attributeFormDefault="unqualified">
19+
<xs:element name="Events">
20+
<xs:annotation>
21+
<xs:documentation>Log4J 2.0 XML Schema for XML log event files.</xs:documentation>
22+
</xs:annotation>
23+
<xs:complexType>
24+
<xs:sequence>
25+
<xs:element name="Event" minOccurs="0" maxOccurs="unbounded">
26+
<xs:complexType>
27+
<xs:sequence>
28+
<xs:element name="Message"/>
29+
<xs:element name="NDC" minOccurs="0"/>
30+
<xs:element name="Marker" minOccurs="0">
31+
<xs:complexType mixed="true">
32+
<xs:attribute name="parent" type="xs:string" use="optional"/>
33+
</xs:complexType>
34+
</xs:element>
35+
<xs:element name="Throwable" minOccurs="0"/>
36+
<xs:element name="LocationInfo" minOccurs="0">
37+
<xs:complexType>
38+
<xs:attribute name="class" type="xs:string" use="required"/>
39+
<xs:attribute name="method" type="xs:string" use="required"/>
40+
<xs:attribute name="file" type="xs:string" use="required"/>
41+
<xs:attribute name="line" type="xs:int" use="required"/>
42+
</xs:complexType>
43+
</xs:element>
44+
<xs:element name="Properties" minOccurs="0">
45+
<xs:complexType>
46+
<xs:sequence>
47+
<xs:element name="Data" maxOccurs="unbounded">
48+
<xs:complexType>
49+
<xs:attribute name="name" type="xs:string" use="required"/>
50+
<xs:attribute name="value" use="required"/>
51+
</xs:complexType>
52+
</xs:element>
53+
</xs:sequence>
54+
</xs:complexType>
55+
</xs:element>
56+
</xs:sequence>
57+
<xs:attribute name="logger" type="xs:string" use="required"/>
58+
<xs:attribute name="timestamp" type="xs:long" use="required"/>
59+
<xs:attribute name="nanoTime" type="xs:long" use="optional"/>
60+
<xs:attribute name="level" type="log4j:LevelEnum" use="required"/>
61+
<xs:attribute name="threadId" type="xs:long" use="required"/>
62+
<xs:attribute name="thread" type="xs:string" use="required"/>
63+
<xs:attribute name="threadPriority" type="xs:integer" use="required"/>
64+
</xs:complexType>
65+
</xs:element>
66+
</xs:sequence>
67+
</xs:complexType>
68+
</xs:element>
69+
<xs:simpleType name="LevelEnum">
70+
<xs:restriction base="xs:string">
71+
<xs:enumeration value="OFF"/>
72+
<xs:enumeration value="FATAL"/>
73+
<xs:enumeration value="ERROR"/>
74+
<xs:enumeration value="WARN"/>
75+
<xs:enumeration value="INFO"/>
76+
<xs:enumeration value="DEBUG"/>
77+
<xs:enumeration value="TRACE"/>
78+
<xs:enumeration value="ALL"/>
79+
</xs:restriction>
80+
</xs:simpleType>
81+
</xs:schema>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:log4j="http://logging.apache.org/log4j/2.0/events" targetNamespace="http://logging.apache.org/log4j/2.0/events" elementFormDefault="qualified" attributeFormDefault="unqualified">
19+
<xs:simpleType name="LevelEnum">
20+
<xs:restriction base="xs:string">
21+
<xs:enumeration value="OFF"/>
22+
<xs:enumeration value="FATAL"/>
23+
<xs:enumeration value="ERROR"/>
24+
<xs:enumeration value="WARN"/>
25+
<xs:enumeration value="INFO"/>
26+
<xs:enumeration value="DEBUG"/>
27+
<xs:enumeration value="TRACE"/>
28+
<xs:enumeration value="ALL"/>
29+
</xs:restriction>
30+
</xs:simpleType>
31+
</xs:schema>

0 commit comments

Comments
 (0)