jboss-as-logging_1_0.xsd 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ JBoss, Home of Professional Open Source.
  4. ~ Copyright 2011, Red Hat, Inc., and individual contributors
  5. ~ as indicated by the @author tags. See the copyright.txt file in the
  6. ~ distribution for a full listing of individual contributors.
  7. ~
  8. ~ This is free software; you can redistribute it and/or modify it
  9. ~ under the terms of the GNU Lesser General Public License as
  10. ~ published by the Free Software Foundation; either version 2.1 of
  11. ~ the License, or (at your option) any later version.
  12. ~
  13. ~ This software is distributed in the hope that it will be useful,
  14. ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. ~ Lesser General Public License for more details.
  17. ~
  18. ~ You should have received a copy of the GNU Lesser General Public
  19. ~ License along with this software; if not, write to the Free
  20. ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  21. ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  22. -->
  23. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  24. targetNamespace="urn:jboss:domain:logging:1.0"
  25. xmlns="urn:jboss:domain:logging:1.0"
  26. elementFormDefault="qualified"
  27. attributeFormDefault="unqualified"
  28. version="1.0">
  29. <!-- The logging subsystem root element -->
  30. <xs:element name="subsystem" type="subsystem"/>
  31. <xs:complexType name="subsystem">
  32. <xs:annotation>
  33. <xs:documentation>
  34. <![CDATA[
  35. The configuration of the logging subsystem.
  36. ]]>
  37. </xs:documentation>
  38. </xs:annotation>
  39. <xs:choice minOccurs="0" maxOccurs="unbounded">
  40. <xs:element name="logger" type="loggerType"/>
  41. <xs:element name="root-logger" type="rootLoggerType"/>
  42. <xs:element name="console-handler" type="consoleHandlerType"/>
  43. <xs:element name="file-handler" type="fileHandlerType"/>
  44. <xs:element name="periodic-rotating-file-handler" type="periodicFileHandlerType"/>
  45. <xs:element name="size-rotating-file-handler" type="sizeFileHandlerType"/>
  46. <xs:element name="async-handler" type="asyncHandlerType"/>
  47. </xs:choice>
  48. </xs:complexType>
  49. <xs:complexType name="propertiesType">
  50. <xs:annotation>
  51. <xs:documentation>
  52. A collection of free-form properties.
  53. </xs:documentation>
  54. </xs:annotation>
  55. <xs:choice minOccurs="0" maxOccurs="unbounded">
  56. <xs:element name="property">
  57. <xs:complexType>
  58. <xs:attribute name="name" type="xs:string" use="required"/>
  59. <xs:attribute name="value" type="xs:string" use="optional"/>
  60. </xs:complexType>
  61. </xs:element>
  62. </xs:choice>
  63. </xs:complexType>
  64. <xs:complexType name="refType">
  65. <xs:annotation>
  66. <xs:documentation>
  67. A named reference to another object.
  68. </xs:documentation>
  69. </xs:annotation>
  70. <xs:attribute name="name" type="xs:string" use="required"/>
  71. </xs:complexType>
  72. <xs:complexType name="handlersType">
  73. <xs:annotation>
  74. <xs:documentation>
  75. A collection of handlers to apply to the enclosing object.
  76. </xs:documentation>
  77. </xs:annotation>
  78. <xs:choice minOccurs="0" maxOccurs="unbounded">
  79. <xs:element name="handler" type="refType"/>
  80. </xs:choice>
  81. </xs:complexType>
  82. <xs:complexType name="rootLoggerType">
  83. <xs:annotation>
  84. <xs:documentation>
  85. Defines the root logger for this log context.
  86. </xs:documentation>
  87. </xs:annotation>
  88. <xs:all minOccurs="1" maxOccurs="1">
  89. <xs:element name="level" type="refType" minOccurs="0"/>
  90. <xs:element name="filter" type="filterType" minOccurs="0"/>
  91. <xs:element name="handlers" type="handlersType" minOccurs="0"/>
  92. </xs:all>
  93. </xs:complexType>
  94. <xs:complexType name="loggerType">
  95. <xs:annotation>
  96. <xs:documentation>
  97. Defines a logger category.
  98. </xs:documentation>
  99. </xs:annotation>
  100. <xs:complexContent>
  101. <xs:extension base="rootLoggerType">
  102. <xs:attribute name="use-parent-handlers" type="xs:boolean" use="optional" default="true"/>
  103. <xs:attribute name="category" type="xs:string" use="required"/>
  104. </xs:extension>
  105. </xs:complexContent>
  106. </xs:complexType>
  107. <xs:complexType name="consoleHandlerType">
  108. <xs:annotation>
  109. <xs:documentation>
  110. Defines a handler which writes to the console.
  111. </xs:documentation>
  112. </xs:annotation>
  113. <xs:all>
  114. <xs:element name="level" type="refType" minOccurs="0"/>
  115. <xs:element name="encoding" type="valueType" minOccurs="0"/>
  116. <xs:element name="filter" type="filterType" minOccurs="0"/>
  117. <xs:element name="formatter" type="formatterType" minOccurs="0"/>
  118. <xs:element name="target" minOccurs="0">
  119. <xs:complexType>
  120. <xs:attribute name="name" use="required">
  121. <xs:simpleType>
  122. <xs:restriction base="xs:token">
  123. <xs:enumeration value="System.out"/>
  124. <xs:enumeration value="System.err"/>
  125. </xs:restriction>
  126. </xs:simpleType>
  127. </xs:attribute>
  128. </xs:complexType>
  129. </xs:element>
  130. </xs:all>
  131. <xs:attribute name="autoflush" type="xs:boolean" use="optional" default="true"/>
  132. <xs:attribute name="name" type="xs:string" use="required"/>
  133. </xs:complexType>
  134. <xs:complexType name="fileHandlerType">
  135. <xs:annotation>
  136. <xs:documentation>
  137. Defines a handler which writes to a file.
  138. </xs:documentation>
  139. </xs:annotation>
  140. <xs:all>
  141. <xs:element name="level" type="refType" minOccurs="0"/>
  142. <xs:element name="encoding" type="valueType" minOccurs="0"/>
  143. <xs:element name="filter" type="filterType" minOccurs="0"/>
  144. <xs:element name="formatter" type="formatterType" minOccurs="0"/>
  145. <xs:element name="file" type="pathType" minOccurs="1"/>
  146. <xs:element name="append" type="booleanValueType" minOccurs="0"/>
  147. </xs:all>
  148. <xs:attribute name="autoflush" type="xs:boolean" use="optional" default="true"/>
  149. <xs:attribute name="name" type="xs:string" use="required"/>
  150. </xs:complexType>
  151. <xs:complexType name="periodicFileHandlerType">
  152. <xs:annotation>
  153. <xs:documentation>
  154. Defines a handler which writes to a file, rotating the log after a time period derived from the given
  155. suffix string, which should be in a format understood by java.text.SimpleDateFormat.
  156. </xs:documentation>
  157. </xs:annotation>
  158. <xs:all>
  159. <xs:element name="level" type="refType" minOccurs="0"/>
  160. <xs:element name="encoding" type="valueType" minOccurs="0"/>
  161. <xs:element name="filter" type="filterType" minOccurs="0"/>
  162. <xs:element name="formatter" type="formatterType" minOccurs="0"/>
  163. <xs:element name="file" type="pathType"/>
  164. <xs:element name="suffix" type="valueType"/>
  165. <xs:element name="append" type="booleanValueType" minOccurs="0"/>
  166. </xs:all>
  167. <xs:attribute name="autoflush" type="xs:boolean" use="optional" default="true"/>
  168. <xs:attribute name="name" type="xs:string" use="required"/>
  169. </xs:complexType>
  170. <xs:complexType name="sizeFileHandlerType">
  171. <xs:annotation>
  172. <xs:documentation>
  173. Defines a handler which writes to a file, rotating the log after a the size of the file grows beyond a
  174. certain point and keeping a fixed number of backups.
  175. </xs:documentation>
  176. </xs:annotation>
  177. <xs:all>
  178. <xs:element name="level" type="refType" minOccurs="0"/>
  179. <xs:element name="encoding" type="valueType" minOccurs="0"/>
  180. <xs:element name="filter" type="filterType" minOccurs="0"/>
  181. <xs:element name="formatter" type="formatterType" minOccurs="0"/>
  182. <xs:element name="file" type="pathType"/>
  183. <xs:element name="rotate-size" type="sizeType" minOccurs="0"/>
  184. <xs:element name="max-backup-index" type="positiveIntType" minOccurs="0"/>
  185. <xs:element name="append" type="booleanValueType" minOccurs="0"/>
  186. </xs:all>
  187. <xs:attribute name="autoflush" type="xs:boolean" use="optional" default="true"/>
  188. <xs:attribute name="name" type="xs:string" use="required"/>
  189. </xs:complexType>
  190. <xs:complexType name="asyncHandlerType">
  191. <xs:annotation>
  192. <xs:documentation>
  193. Defines a handler which writes to the sub-handlers in an asynchronous thread. Used for handlers which
  194. introduce a substantial amount of lag.
  195. </xs:documentation>
  196. </xs:annotation>
  197. <xs:all>
  198. <xs:element name="level" type="refType" minOccurs="0"/>
  199. <xs:element name="filter" type="filterType" minOccurs="0"/>
  200. <xs:element name="queue-length" type="queueLengthType" minOccurs="1" maxOccurs="1"/>
  201. <xs:element name="overflow-action" type="overflowActionType" minOccurs="0"/>
  202. <xs:element name="subhandlers" type="handlersType"/>
  203. </xs:all>
  204. <xs:attribute name="name" type="xs:string" use="required"/>
  205. </xs:complexType>
  206. <xs:complexType name="queueLengthType">
  207. <xs:attribute name="value" use="required">
  208. <xs:simpleType>
  209. <xs:restriction base="xs:positiveInteger">
  210. <xs:minExclusive value="1"/>
  211. </xs:restriction>
  212. </xs:simpleType>
  213. </xs:attribute>
  214. </xs:complexType>
  215. <xs:complexType name="overflowActionType">
  216. <xs:attribute name="value" use="required">
  217. <xs:simpleType>
  218. <xs:restriction base="xs:token">
  219. <xs:enumeration value="block"/>
  220. <xs:enumeration value="discard"/>
  221. </xs:restriction>
  222. </xs:simpleType>
  223. </xs:attribute>
  224. </xs:complexType>
  225. <xs:complexType name="positiveIntType">
  226. <xs:attribute name="value" use="required" type="xs:positiveInteger"/>
  227. </xs:complexType>
  228. <xs:complexType name="booleanValueType">
  229. <xs:attribute name="value" use="required" type="xs:boolean"/>
  230. </xs:complexType>
  231. <xs:complexType name="valueType">
  232. <xs:attribute name="value" use="required" type="xs:string"/>
  233. </xs:complexType>
  234. <xs:complexType name="pathType">
  235. <xs:attribute name="relative-to" use="optional" type="xs:string"/>
  236. <xs:attribute name="path" use="required" type="xs:string"/>
  237. </xs:complexType>
  238. <xs:complexType name="sizeType">
  239. <xs:attribute name="value">
  240. <xs:simpleType>
  241. <xs:restriction base="xs:string">
  242. <!-- XSD doesn't allow ^ or $ so ^[0-9]+[bkmgtp]?$ is invalid -->
  243. <xs:pattern value="[0-9]+[bkmgtp]"/>
  244. </xs:restriction>
  245. </xs:simpleType>
  246. </xs:attribute>
  247. </xs:complexType>
  248. <xs:complexType name="filterType">
  249. <xs:annotation>
  250. <xs:documentation>
  251. Defines a simple filter type.
  252. </xs:documentation>
  253. </xs:annotation>
  254. <xs:group ref="simpleFilterGroup"/>
  255. </xs:complexType>
  256. <xs:complexType name="multiFilterType">
  257. <xs:annotation>
  258. <xs:documentation>
  259. Defines a composite filter type. The "any" filter will return true of any of its constituent filters
  260. returns true; the "all" filter will return false if any of its constituent filters returns false. Both
  261. composite filter types are short-circuiting, meaning that if the result can be determined with an earlier
  262. filter, later filters are not run.
  263. </xs:documentation>
  264. </xs:annotation>
  265. <xs:group ref="simpleFilterGroup" maxOccurs="unbounded"/>
  266. </xs:complexType>
  267. <xs:group name="simpleFilterGroup">
  268. <xs:choice>
  269. <xs:element name="all" type="multiFilterType"/>
  270. <xs:element name="any" type="multiFilterType"/>
  271. <xs:element name="accept"/>
  272. <xs:element name="deny"/>
  273. <xs:element name="not" type="filterType"/>
  274. <xs:element name="match" type="regexFilterType"/>
  275. <xs:element name="replace" type="replaceFilterType"/>
  276. <xs:element name="level" type="levelFilterType"/>
  277. <xs:element name="level-range" type="levelRangeFilterType"/>
  278. <xs:element name="change-level" type="levelChangeFilterType"/>
  279. </xs:choice>
  280. </xs:group>
  281. <xs:complexType name="regexFilterType">
  282. <xs:annotation>
  283. <xs:documentation>
  284. A regular expression-based filter. The filter returns true if the pattern matches.
  285. </xs:documentation>
  286. </xs:annotation>
  287. <xs:attribute name="pattern" type="xs:string" use="required"/>
  288. </xs:complexType>
  289. <xs:complexType name="replaceFilterType">
  290. <xs:annotation>
  291. <xs:documentation>
  292. A regular expression substitution filter. This filter modifies the log message and always returns true.
  293. </xs:documentation>
  294. </xs:annotation>
  295. <xs:attribute name="pattern" type="xs:string" use="required"/>
  296. <xs:attribute name="replacement" type="xs:string" use="required"/>
  297. <xs:attribute name="replace-all" type="xs:boolean" default="true"/>
  298. </xs:complexType>
  299. <xs:complexType name="levelFilterType">
  300. <xs:annotation>
  301. <xs:documentation>
  302. A level filter. This filter returns true if the log message level matches the parameter. It is a
  303. numerical match; two differently-named levels with the same numeric value will be considered equal.
  304. </xs:documentation>
  305. </xs:annotation>
  306. <xs:attribute name="name" type="xs:string" use="required"/>
  307. </xs:complexType>
  308. <xs:complexType name="levelRangeFilterType">
  309. <xs:annotation>
  310. <xs:documentation>
  311. A level range filter. This filter returns true if the log message level matches the range specified
  312. by the parameters. It is a
  313. numerical match; two differently-named levels with the same numeric value will be considered equal.
  314. </xs:documentation>
  315. </xs:annotation>
  316. <xs:attribute name="min-level" type="xs:string" use="required"/>
  317. <xs:attribute name="min-inclusive" type="xs:boolean" use="optional" default="true"/>
  318. <xs:attribute name="max-level" type="xs:string" use="required"/>
  319. <xs:attribute name="max-inclusive" type="xs:boolean" use="optional" default="true"/>
  320. </xs:complexType>
  321. <xs:complexType name="levelChangeFilterType">
  322. <xs:annotation>
  323. <xs:documentation>
  324. A level change filter. This filter modifies the log message and always returns true.
  325. </xs:documentation>
  326. </xs:annotation>
  327. <xs:attribute name="new-level" type="xs:string" use="required"/>
  328. </xs:complexType>
  329. <!-- Formatters -->
  330. <xs:complexType name="formatterType">
  331. <xs:annotation>
  332. <xs:documentation>
  333. Defines a formatter.
  334. </xs:documentation>
  335. </xs:annotation>
  336. <xs:choice minOccurs="1" maxOccurs="1">
  337. <xs:element name="pattern-formatter" type="patternFormatterType" maxOccurs="1"/>
  338. </xs:choice>
  339. </xs:complexType>
  340. <xs:complexType name="patternFormatterType">
  341. <xs:annotation>
  342. <xs:documentation>
  343. Defines a pattern formatter. See the documentation for org.jboss.logmanager.formatters.FormatStringParser
  344. for more information about the format string.
  345. </xs:documentation>
  346. </xs:annotation>
  347. <xs:attribute name="pattern" type="xs:string" use="required"/>
  348. </xs:complexType>
  349. </xs:schema>