Move Log4j2 from experimental to its own trunk
git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL@1241271 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/rgoers/checkstyle-header.txt b/rgoers/checkstyle-header.txt
deleted file mode 100644
index 4f33236..0000000
--- a/rgoers/checkstyle-header.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
diff --git a/rgoers/checkstyle.xml b/rgoers/checkstyle.xml
deleted file mode 100644
index 623b3e9..0000000
--- a/rgoers/checkstyle.xml
+++ /dev/null
@@ -1,217 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE module PUBLIC
- "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
- "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Checkstyle configuration that checks the commons-configuration coding conventions -->
-
-<module name="Checker">
- <property name="localeLanguage" value="en"/>
-
- <!-- Checks that a package.html file exists for each package. -->
- <!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
- <module name="JavadocPackage"/>
-
- <!-- Checks whether files end with a new line. -->
- <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
- <module name="NewlineAtEndOfFile"/>
-
- <!-- Checks that property files contain the same keys. -->
- <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
- <module name="Translation"/>
-
- <!-- Checks for Headers -->
- <!-- See http://checkstyle.sourceforge.net/config_header.html#Header -->
- <module name="Header">
- <property name="headerFile" value="${licensedir}"/>
- <property name="fileExtensions" value="java"/>
- <!--<property name="ignoreLines" value="2"/> -->
- </module>
-
- <!-- Checks for Tab characters -->
- <!-- See http://checkstyle.sourceforge.net/config_whitespace.html#FileTabCharacter -->
- <module name="FileTabCharacter">
- <property name="fileExtensions" value="java"/>
- </module>
-
- <!-- Checks for white space at the end of the line -->
- <!-- See http://checkstyle.sourceforge.net/config_regexp.html -->
- <module name="RegexpSingleline">
- <property name="format" value="\s+$"/>
- <property name="message" value="Line has trailing spaces."/>
- <property name="fileExtensions" value="java"/>
- </module>
-
- <!-- Exceptions -->
- <!--<module name="SuppressionFilter">
- <property name="file" value="conf/checkstyle-suppressions.xml"/>
- </module> -->
-
- <module name="TreeWalker">
-
- <property name="cacheFile" value="${checkstyle.cache.file}"/>
-
- <!-- Checks for Javadoc comments. -->
- <!-- See http://checkstyle.sf.net/config_javadoc.html -->
- <module name="JavadocMethod">
- <property name="scope" value="public"/>
- <property name="allowUndeclaredRTE" value="true"/>
- <property name="allowMissingJavadoc" value="true"/>
- </module>
- <module name="JavadocType">
- <!-- <property name="authorFormat" value="null"/> -->
- <!-- It is unfortunate to have to do this but checkstyle doesn't allow custom tags -->
- <property name="allowUnknownTags" value="true"/>
- </module>
- <module name="JavadocVariable">
- <property name="scope" value="protected"/>
- </module>
- <module name="JavadocStyle">
- <property name="scope" value="public"/>
- <!-- the checkHtml check is disabled as it generates incorrect errors -->
- <property name="checkHtml" value="false"/>
- </module>
-
-
- <!-- Checks for Naming Conventions. -->
- <!-- See http://checkstyle.sf.net/config_naming.html -->
- <module name="ConstantName">
- <property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$|^capabilities$|^log$"/>
- </module>
- <module name="LocalFinalVariableName"/>
- <module name="LocalVariableName"/>
- <module name="MemberName"/>
- <module name="MethodName"/>
- <module name="PackageName"/>
- <module name="ParameterName"/>
- <module name="StaticVariableName"/>
- <module name="TypeName"/>
-
- <!-- Following interprets the header file as regular expressions. -->
- <!-- <module name="RegexpHeader"/> -->
-
-
- <!-- Checks for imports -->
- <!-- See http://checkstyle.sf.net/config_import.html -->
- <module name="AvoidStarImport"/>
- <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
- <module name="RedundantImport"/>
- <module name="UnusedImports"/>
-
-
- <!-- Checks for Size Violations. -->
- <!-- See http://checkstyle.sf.net/config_sizes.html -->
- <!--<module name="FileLength"/>-->
- <module name="LineLength">
- <property name="max" value="120"/>
- </module>
- <module name="MethodLength"/>
- <module name="ParameterNumber">
- <property name="max" value="15"/>
- </module>
-
-
- <!-- Checks for whitespace -->
- <!-- See http://checkstyle.sf.net/config_whitespace.html -->
- <module name="EmptyForIteratorPad"/>
- <module name="NoWhitespaceAfter"/>
- <module name="NoWhitespaceBefore"/>
- <module name="OperatorWrap">
- <property name="tokens" value="ASSIGN"/>
- <property name="option" value="eol"/>
- </module>
- <module name="ParenPad"/>
- <module name="WhitespaceAfter"/>
- <module name="WhitespaceAround"/>
- <module name="GenericWhitespace"/>
-
-
- <!-- Modifier Checks -->
- <!-- See http://checkstyle.sf.net/config_modifiers.html -->
- <module name="ModifierOrder"/>
- <module name="RedundantModifier"/>
-
-
- <!-- Checks for blocks. You know, those {}'s -->
- <!-- See http://checkstyle.sf.net/config_blocks.html -->
- <module name="AvoidNestedBlocks">
- <property name="allowInSwitchCase" value="true"/>
- </module>
- <!-- Require empty catch blocks to have at least a comment -->
- <module name="EmptyBlock">
- <property name="option" value="text"/>
- <property name="tokens" value="LITERAL_CATCH"/>
- </module>
- <module name="LeftCurly">
- <property name="option" value="eol"/>
- </module>
- <module name="NeedBraces"/>
- <module name="RightCurly">
- <property name="option" value="same"/>
- </module>
-
-
- <!-- Checks for common coding problems -->
- <!-- See http://checkstyle.sf.net/config_coding.html -->
- <module name="CovariantEquals"/>
- <module name="DoubleCheckedLocking"/>
- <module name="EqualsHashCode"/>
- <module name="IllegalInstantiation"/>
- <!-- <module name="InnerAssignment"/> -->
- <module name="MagicNumber">
- <property name="ignoreNumbers" value="-1,0,1,2,3,4,5,6,7"/>
- </module>
- <module name="RedundantThrows">
- <property name="allowUnchecked" value="true"/>
- </module>
- <module name="SimplifyBooleanExpression"/>
- <module name="SimplifyBooleanReturn"/>
- <module name="StringLiteralEquality"/>
- <module name="SuperClone"/>
- <module name="SuperFinalize"/>
- <module name="DeclarationOrder"/>
- <!-- <module name="ExplicitInitialization"/> -->
- <module name="DefaultComesLast"/>
- <module name="FallThrough"/>
- <module name="MultipleVariableDeclarations"/>
- <!-- <module name="UnnecessaryParentheses"/> -->
-
- <!-- Checks for class design -->
- <!-- See http://checkstyle.sf.net/config_design.html -->
- <module name="FinalClass"/>
- <module name="HideUtilityClassConstructor"/>
- <module name="InterfaceIsType"/>
- <module name="VisibilityModifier">
- <property name="protectedAllowed" value="true"/>
- </module>
-
-
-
- <!-- Miscellaneous other checks. -->
- <!-- See http://checkstyle.sf.net/config_misc.html -->
- <module name="ArrayTypeStyle"/>
- <module name="TodoComment">
- <property name="severity" value="info"/>
- </module>
- <module name="UpperEll"/>
-
- </module>
-
-</module>
diff --git a/rgoers/findbugs-exclude-filter.xml b/rgoers/findbugs-exclude-filter.xml
deleted file mode 100644
index 327be31..0000000
--- a/rgoers/findbugs-exclude-filter.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- ===================================================================== -->
-<!-- $Id: findbugs-exclude-filter.xml 773234 2009-05-09 15:27:59Z rgoers $ -->
-<!-- ===================================================================== -->
-<FindBugsFilter>
- <!-- Enable only high priority warnings -->
- <Match>
- <Priority value="2"/>
- </Match>
-
- <Match>
- <Priority value="3"/>
- </Match>
-</FindBugsFilter>
diff --git a/rgoers/log4j12-api/LICENSE b/rgoers/log4j12-api/LICENSE
deleted file mode 100644
index 6279e52..0000000
--- a/rgoers/log4j12-api/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 1999-2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/rgoers/log4j12-api/NOTICE b/rgoers/log4j12-api/NOTICE
deleted file mode 100644
index 6233b56..0000000
--- a/rgoers/log4j12-api/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache log4j Enhanced PatternLayout for log4j 1.2.x
-Copyright 2007 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/rgoers/log4j12-api/pom.xml b/rgoers/log4j12-api/pom.xml
deleted file mode 100644
index 80c79b6..0000000
--- a/rgoers/log4j12-api/pom.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2</artifactId>
- <version>1.99.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j12-api</artifactId>
- <packaging>jar</packaging>
- <name>Log4J Compatibility API</name>
- <description>The Log4J Compatibility API</description>
- <properties>
- <log4j.parent.dir>${basedir}/..</log4j.parent.dir>
- </properties>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.3.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-core</artifactId>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-changes-plugin</artifactId>
- <version>2.6</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>changes-report</report>
- </reports>
- </reportSet>
- </reportSets>
- <configuration>
- <issueLinkTemplate>%URL%/show_bug.cgi?id=%ISSUE%</issueLinkTemplate>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.7</version>
- <configuration>
- <!--<propertiesLocation>${vfs.parent.dir}/checkstyle.properties</propertiesLocation> -->
- <configLocation>${log4j.parent.dir}/checkstyle.xml</configLocation>
- <suppressionsLocation>${log4j.parent.dir}/checkstyle-suppressions.xml</suppressionsLocation>
- <enableRulesSummary>false</enableRulesSummary>
- <propertyExpansion>basedir=${basedir}</propertyExpansion>
- <propertyExpansion>licensedir=${log4j.parent.dir}/checkstyle-header.txt</propertyExpansion>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating
- project -->
- <detectOfflineLinks>false</detectOfflineLinks>
- <linksource>true</linksource>
- <tags>
- <tag>
- <name>issue</name>
- <placement>a</placement>
- <head>JIRA issue:</head>
- </tag>
- <tag>
- <name>doubt</name>
- <placement>a</placement>
- <head>Troublesome:</head>
- </tag>
- <tag>
- <name>compare</name>
- <placement>a</placement>
- <head>Compare with:</head>
- </tag>
- </tags>
- </configuration>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>javadoc</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <threshold>Normal</threshold>
- <effort>Default</effort>
- <excludeFilterFile>findbugs-exclude-filter.xml</excludeFilterFile>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.3</version>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>jxr</report>
- </reports>
- </reportSet>
- <reportSet>
- <id>aggregate</id>
- <reports>
- <report>aggregate</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.2</version>
- <reportSets>
- <reportSet>
- <!-- Disabled at it kills the site generation via a NoClassDefFoundError -->
- <reports/>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
-</project>
-
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Category.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/Category.java
deleted file mode 100644
index 1922820..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Category.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.helpers.NameUtil;
-import org.apache.logging.log4j.message.LocalizedMessage;
-import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.message.ObjectMessage;
-
-import java.util.Map;
-import java.util.ResourceBundle;
-import java.util.WeakHashMap;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-
-/**
- * Implementation of the Category class for compatibility, despite it having been deprecated a long, long time ago.
- */
-public class Category {
-
- private static org.apache.log4j.LoggerFactory loggerFactory = new PrivateFactory();
-
- private static final Map<LoggerContext, ConcurrentMap<String, Logger>> CONTEXT_MAP =
- new WeakHashMap<LoggerContext, ConcurrentMap<String, Logger>>();
-
- private static final String FQCN = Category.class.getName();
-
- /**
- * Resource bundle for localized messages.
- */
- protected ResourceBundle bundle = null;
-
- private final org.apache.logging.log4j.core.Logger logger;
-
- /**
- * Constructor used by Logger to specify a LoggerContext.
- * @param context The LoggerContext.
- * @param name The name of the Logger.
- */
- protected Category(LoggerContext context, String name) {
- this.logger = context.getLogger(name);
- }
-
- /**
- * Constructor exposed by Log4j 1.2.
- * @param name The name of the Logger.
- */
- protected Category(String name) {
- this((LoggerContext) PrivateManager.getContext(), name);
- }
-
- private Category(org.apache.logging.log4j.core.Logger logger) {
- this.logger = logger;
- }
-
- public static Category getInstance(String name) {
- return getInstance((LoggerContext) PrivateManager.getContext(), name, loggerFactory);
- }
-
- static Category getInstance(LoggerContext context, String name) {
- return getInstance(context, name, loggerFactory);
- }
-
- static Category getInstance(LoggerContext context, String name, org.apache.log4j.LoggerFactory factory) {
- ConcurrentMap<String, Logger> loggers = getLoggersMap(context);
- Logger logger = loggers.get(name);
- if (logger != null) {
- return logger;
- }
- logger = factory.makeNewLoggerInstance(context, name);
- Logger prev = loggers.putIfAbsent(name, logger);
- return prev == null ? logger : prev;
- }
-
- public static Category getInstance(Class clazz) {
- return getInstance(clazz.getName());
- }
-
- static Category getInstance(LoggerContext context, Class clazz) {
- return getInstance(context, clazz.getName());
- }
-
- public final String getName() {
- return logger.getName();
- }
-
- org.apache.logging.log4j.core.Logger getLogger() {
- return logger;
- }
-
- public final Category getParent() {
- org.apache.logging.log4j.core.Logger parent = logger.getParent();
- if (parent == null) {
- return null;
- }
- ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
- Logger l = loggers.get(parent.getName());
- return l == null ? new Category(parent) : l;
- }
-
- public static Category getRoot() {
- return getInstance("");
- }
-
-
- static Category getRoot(LoggerContext context) {
- return getInstance(context, "");
- }
-
- private static ConcurrentMap<String, Logger> getLoggersMap(LoggerContext context) {
- synchronized (CONTEXT_MAP) {
- ConcurrentMap<String, Logger> map = CONTEXT_MAP.get(context);
- if (map == null) {
- map = new ConcurrentHashMap<String, Logger>();
- CONTEXT_MAP.put(context, map);
- }
- return map;
- }
- }
-
- public final Level getEffectiveLevel() {
- org.apache.logging.log4j.Level level = logger.getLevel();
-
- switch (level) {
- case TRACE:
- return Level.TRACE;
- case DEBUG:
- return Level.DEBUG;
- case INFO:
- return Level.INFO;
- case WARN:
- return Level.WARN;
- default:
- return Level.ERROR;
- }
- }
-
- public final Priority getChainedPriority() {
- return getEffectiveLevel();
- }
-
- public final Level getLevel() {
- return getEffectiveLevel();
- }
-
- public void setLevel(Level level) {
- logger.setLevel(org.apache.logging.log4j.Level.toLevel(level.levelStr));
- }
-
- public final Level getPriority() {
- return getEffectiveLevel();
- }
-
- public void setPriority(Priority priority) {
- logger.setLevel(org.apache.logging.log4j.Level.toLevel(priority.levelStr));
- }
-
- public void debug(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.DEBUG, message, null);
- }
-
- public void debug(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.DEBUG, message, t);
- }
-
- public boolean isDebugEnabled() {
- return logger.isDebugEnabled();
- }
-
- public void error(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.ERROR, message, null);
- }
-
- public void error(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.ERROR, message, t);
- }
-
- public boolean isErrorEnabled() {
- return logger.isErrorEnabled();
- }
-
- public void warn(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.WARN, message, null);
- }
-
- public void warn(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.WARN, message, t);
- }
-
- public boolean isWarnEnabled() {
- return logger.isWarnEnabled();
- }
-
- public void fatal(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.FATAL, message, null);
- }
-
- public void fatal(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.FATAL, message, t);
- }
-
- public boolean isFatalEnabled() {
- return logger.isFatalEnabled();
- }
-
- public void info(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.INFO, message, null);
- }
-
- public void info(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.INFO, message, t);
- }
-
- public boolean isInfoEnabled() {
- return logger.isInfoEnabled();
- }
-
- public void trace(Object message) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.TRACE, message, null);
- }
-
- public void trace(Object message, Throwable t) {
- maybeLog(FQCN, org.apache.logging.log4j.Level.TRACE, message, t);
- }
-
- public boolean isTraceEnabled() {
- return logger.isTraceEnabled();
- }
-
- public boolean isEnabledFor(Priority level) {
- org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
- return isEnabledFor(lvl);
- }
-
- public void forcedLog(String fqcn, Priority level, Object message, Throwable t) {
- org.apache.logging.log4j.Level lvl = org.apache.logging.log4j.Level.toLevel(level.toString());
- logger.log(null, fqcn, lvl, new ObjectMessage(message), t);
- }
-
- public boolean exists(String name) {
- return PrivateManager.getContext().hasLogger(name);
- }
-
- public boolean getAdditivity() {
- return logger.isAdditive();
- }
-
- public void setAdditivity(boolean additivity) {
- logger.setAdditive(additivity);
- }
-
- public void setResourceBundle(ResourceBundle bundle) {
- this.bundle = bundle;
- }
-
- public ResourceBundle getResourceBundle() {
- if (bundle != null) {
- return bundle;
- }
- int i = 0;
- String name = logger.getName();
- ConcurrentMap<String, Logger> loggers = getLoggersMap(logger.getContext());
- while ((name = NameUtil.getSubName(name)) != null) {
- if (loggers.containsKey(name)) {
- ResourceBundle rb = loggers.get(name).bundle;
- if (rb != null) {
- return rb;
- }
- }
- }
- return null;
- }
-
- public void l7dlog(Priority priority, String key, Throwable t) {
- if (isEnabledFor(priority)) {
- Message msg = new LocalizedMessage(bundle, key, null);
- forcedLog(FQCN, priority, msg, t);
- }
- }
-
- public void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
- if (isEnabledFor(priority)) {
- Message msg = new LocalizedMessage(bundle, key, params);
- forcedLog(FQCN, priority, msg, t);
- }
- }
-
- private void maybeLog(String fqcn, org.apache.logging.log4j.Level level,
- Object message, Throwable throwable) {
- if(logger.isEnabled(level, null, message, throwable)) {
- logger.log(null, FQCN, level, new ObjectMessage(message), throwable);
- }
- }
-
- /**
- * Private logger factory.
- */
- private static class PrivateFactory implements org.apache.log4j.LoggerFactory {
-
- public Logger makeNewLoggerInstance(LoggerContext context, String name) {
- return new Logger(context, name);
- }
- }
-
- /**
- * Private LogManager.
- */
- private static class PrivateManager extends org.apache.logging.log4j.LogManager {
- private static final String FQCN = Category.class.getName();
-
- public static org.apache.logging.log4j.spi.LoggerContext getContext() {
- return getContext(FQCN, false);
- }
-
- public static org.apache.logging.log4j.Logger getLogger(String name) {
- return getLogger(FQCN, name);
- }
- }
-
- private boolean isEnabledFor(org.apache.logging.log4j.Level level) {
- return logger.isEnabled(level, null, null);
- }
-
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Level.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/Level.java
deleted file mode 100644
index b0a0940..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Level.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-
-/**
- * Defines the minimum set of levels recognized by the system, that is
- * <code>OFF</code>, <code>FATAL</code>, <code>ERROR</code>,
- * <code>WARN</code>, <code>INFO</code, <code>DEBUG</code>
- * and
- * <code>ALL</code>.
- * <p/>
- * <p>The <code>Level</code> class may be subclassed to define a larger
- * level set.
- */
-public class Level extends Priority implements Serializable {
-
- /**
- * TRACE level integer value.
- *
- * @since 1.2.12
- */
- public static final int TRACE_INT = 5000;
-
- /**
- * The <code>OFF</code> has the highest possible rank and is
- * intended to turn off logging.
- */
- public static final Level OFF = new Level(OFF_INT, "OFF", 0);
-
- /**
- * The <code>FATAL</code> level designates very severe error
- * events that will presumably lead the application to abort.
- */
- public static final Level FATAL = new Level(FATAL_INT, "FATAL", 0);
-
- /**
- * The <code>ERROR</code> level designates error events that
- * might still allow the application to continue running.
- */
- public static final Level ERROR = new Level(ERROR_INT, "ERROR", 3);
-
- /**
- * The <code>WARN</code> level designates potentially harmful situations.
- */
- public static final Level WARN = new Level(WARN_INT, "WARN", 4);
-
- /**
- * The <code>INFO</code> level designates informational messages
- * that highlight the progress of the application at coarse-grained
- * level.
- */
- public static final Level INFO = new Level(INFO_INT, "INFO", 6);
-
- /**
- * The <code>DEBUG</code> Level designates fine-grained
- * informational events that are most useful to debug an
- * application.
- */
- public static final Level DEBUG = new Level(DEBUG_INT, "DEBUG", 7);
-
- /**
- * The <code>TRACE</code> Level designates finer-grained
- * informational events than the <code>DEBUG</code> level.
- */
- public static final Level TRACE = new Level(TRACE_INT, "TRACE", 7);
-
- /**
- * The <code>ALL</code> has the lowest possible rank and is intended to
- * turn on all logging.
- */
- public static final Level ALL = new Level(ALL_INT, "ALL", 7);
-
- /**
- * Serialization version id.
- */
- private static final long serialVersionUID = 3491141966387921974L;
-
- /**
- * Instantiate a Level object.
- *
- * @param level The logging level.
- * @param levelStr The level name.
- * @param syslogEquivalent The matching syslog level.
- */
- protected Level(int level, String levelStr, int syslogEquivalent) {
- super(level, levelStr, syslogEquivalent);
- }
-
-
- /**
- * Convert the string passed as argument to a level. If the
- * conversion fails, then this method returns {@link #DEBUG}.
- *
- * @param sArg The level name.
- * @return The Level.
- */
- public static Level toLevel(String sArg) {
- return toLevel(sArg, Level.DEBUG);
- }
-
- /**
- * Convert an integer passed as argument to a level. If the
- * conversion fails, then this method returns {@link #DEBUG}.
- *
- * @param val The integer value of the Level.
- * @return The Level.
- */
- public static Level toLevel(int val) {
- return toLevel(val, Level.DEBUG);
- }
-
- /**
- * Convert an integer passed as argument to a level. If the
- * conversion fails, then this method returns the specified default.
- *
- * @param val The integer value of the Level.
- * @param defaultLevel the default level if the integer doesn't match.
- * @return The matching Level.
- */
- public static Level toLevel(int val, Level defaultLevel) {
- switch (val) {
- case ALL_INT:
- return ALL;
- case DEBUG_INT:
- return Level.DEBUG;
- case INFO_INT:
- return Level.INFO;
- case WARN_INT:
- return Level.WARN;
- case ERROR_INT:
- return Level.ERROR;
- case FATAL_INT:
- return Level.FATAL;
- case OFF_INT:
- return OFF;
- case TRACE_INT:
- return Level.TRACE;
- default:
- return defaultLevel;
- }
- }
-
- /**
- * Convert the string passed as argument to a level. If the
- * conversion fails, then this method returns the value of
- * <code>defaultLevel</code>.
- * @param sArg The name of the Level.
- * @param defaultLevel The default Level to use.
- * @return the matching Level.
- */
- public static Level toLevel(String sArg, Level defaultLevel) {
- if (sArg == null) {
- return defaultLevel;
- }
-
- String s = sArg.toUpperCase();
-
- if (s.equals("ALL")) {
- return Level.ALL;
- }
- if (s.equals("DEBUG")) {
- return Level.DEBUG;
- }
- if (s.equals("INFO")) {
- return Level.INFO;
- }
- if (s.equals("WARN")) {
- return Level.WARN;
- }
- if (s.equals("ERROR")) {
- return Level.ERROR;
- }
- if (s.equals("FATAL")) {
- return Level.FATAL;
- }
- if (s.equals("OFF")) {
- return Level.OFF;
- }
- if (s.equals("TRACE")) {
- return Level.TRACE;
- }
- //
- // For Turkish i problem, see bug 40937
- //
- if (s.equals("\u0130NFO")) {
- return Level.INFO;
- }
- return defaultLevel;
- }
-
- /**
- * Custom deserialization of Level.
- *
- * @param s serialization stream.
- * @throws IOException if IO exception.
- * @throws ClassNotFoundException if class not found.
- */
- private void readObject(final ObjectInputStream s) throws IOException, ClassNotFoundException {
- s.defaultReadObject();
- level = s.readInt();
- syslogEquivalent = s.readInt();
- levelStr = s.readUTF();
- if (levelStr == null) {
- levelStr = "";
- }
- }
-
- /**
- * Serialize level.
- *
- * @param s serialization stream.
- * @throws IOException if exception during serialization.
- */
- private void writeObject(final ObjectOutputStream s) throws IOException {
- s.defaultWriteObject();
- s.writeInt(level);
- s.writeInt(syslogEquivalent);
- s.writeUTF(levelStr);
- }
-
- /**
- * Resolved deserialized level to one of the stock instances.
- * May be overriden in classes derived from Level.
- *
- * @return resolved object.
- * @throws ObjectStreamException if exception during resolution.
- */
- protected Object readResolve() throws ObjectStreamException {
- //
- // if the deserizalized object is exactly an instance of Level
- //
- if (getClass() == Level.class) {
- return toLevel(level);
- }
- //
- // extension of Level can't substitute stock item
- //
- return this;
- }
-
-}
-
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/LogManager.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
deleted file mode 100644
index 8bfc699..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/LogManager.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import org.apache.logging.log4j.core.LoggerContext;
-
-/**
- *
- */
-public final class LogManager {
-
- private LogManager() {
- }
-
- public static Logger getRootLogger() {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), "");
- }
-
- public static Logger getLogger(final String name) {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
- }
-
- public static Logger getLogger(final Class clazz) {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), clazz.getName());
- }
-
- public static Logger exists(String name) {
- LoggerContext ctx = (LoggerContext) PrivateManager.getContext();
- if (!ctx.hasLogger(name)) {
- return null;
- }
- return Logger.getLogger(name);
- }
-
- /**
- * Internal LogManager.
- */
- private static class PrivateManager extends org.apache.logging.log4j.LogManager {
- private static final String FQCN = LogManager.class.getName();
-
-
- public static org.apache.logging.log4j.spi.LoggerContext getContext() {
- return getContext(FQCN, false);
- }
-
- public static org.apache.logging.log4j.Logger getLogger(String name) {
- return getLogger(FQCN, name);
- }
- }
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Logger.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/Logger.java
deleted file mode 100644
index e5e7d9c..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Logger.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-
-import org.apache.logging.log4j.core.LoggerContext;
-
-/**
- *
- */
-public class Logger extends Category {
-
- private static final String FQCN = Logger.class.getName();
-
- protected Logger(String name) {
- super((LoggerContext) PrivateManager.getContext(), name);
- }
-
- Logger(LoggerContext context, String name) {
- super(context, name);
- }
-
- public static Logger getLogger(String name) {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name);
- }
-
- public static Logger getLogger(Class clazz) {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), clazz);
- }
-
- public static Logger getRootLogger() {
- return (Logger) Category.getRoot((LoggerContext) PrivateManager.getContext());
- }
-
- public static Logger getLogger(String name, LoggerFactory factory) {
- return (Logger) Category.getInstance((LoggerContext) PrivateManager.getContext(), name, factory);
- }
-
- /**
- * Internal Log Manager.
- */
- private static class PrivateManager extends org.apache.logging.log4j.LogManager {
- private static final String FQCN = Logger.class.getName();
-
- public static org.apache.logging.log4j.spi.LoggerContext getContext() {
- return getContext(FQCN, false);
- }
-
- public static org.apache.logging.log4j.Logger getLogger(String name) {
- return getLogger(FQCN, name);
- }
- }
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/LoggerFactory.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/LoggerFactory.java
deleted file mode 100644
index 9974243..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/LoggerFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-/**
- *
- * Implement this interface to create new instances of Logger or
- * a sub-class of Logger.
- *
- * <p>See <code>examples/subclass/MyLogger.java</code> for an example.
- */
-public interface LoggerFactory {
-
- Logger makeNewLoggerInstance(org.apache.logging.log4j.core.LoggerContext context, String name);
-
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/MDC.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/MDC.java
deleted file mode 100644
index 704e364..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/MDC.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import org.apache.logging.log4j.ThreadContext;
-
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-
-/**
- * This class behaves just like Log4j's MDC would - and so can cause issues with the redeployment of web
- * applications if the Objects stored in the threads Map cannot be garbage collected.
- */
-public final class MDC {
-
-
- private static ThreadLocal<Map<String, Object>> localMap =
- new InheritableThreadLocal<Map<String, Object>>() {
- protected Map<String, Object> initialValue() {
- return new HashMap<String, Object>();
- }
-
- protected Map<String, Object> childValue(Map<String, Object> parentValue) {
- return parentValue == null ? new HashMap<String, Object>() : new HashMap<String, Object>(parentValue);
- }
- };
-
- private MDC() {
- }
-
-
- public static void put(String key, String value) {
- localMap.get().put(key, value);
- ThreadContext.put(key, value);
- }
-
-
- public static void put(String key, Object value) {
- localMap.get().put(key, value);
- ThreadContext.put(key, value.toString());
- }
-
- public static Object get(String key) {
- return localMap.get().get(key);
- }
-
- public static void remove(String key) {
- localMap.get().remove(key);
- ThreadContext.remove(key);
- }
-
- public static void clear() {
- localMap.get().clear();
- ThreadContext.clear();
- }
-
- public static Hashtable getContext() {
- return new Hashtable(localMap.get());
- }
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/NDC.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/NDC.java
deleted file mode 100644
index 91b645f..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/NDC.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import java.util.Stack;
-
-/**
- *
- */
-public final class NDC {
-
- private NDC() {
- }
-
- /**
- * Clear any nested diagnostic information if any. This method is
- * useful in cases where the same thread can be potentially used
- * over and over in different unrelated contexts.
- * <p/>
- * <p>This method is equivalent to calling the {@link #setMaxDepth}
- * method with a zero <code>maxDepth</code> argument.
- */
- public static void clear() {
- org.apache.logging.log4j.ThreadContext.clearStack();
- }
-
-
- /**
- * Clone the diagnostic context for the current thread.
- * <p/>
- * <p>Internally a diagnostic context is represented as a stack. A
- * given thread can supply the stack (i.e. diagnostic context) to a
- * child thread so that the child can inherit the parent thread's
- * diagnostic context.
- * <p/>
- * <p>The child thread uses the {@link #inherit inherit} method to
- * inherit the parent's diagnostic context.
- *
- * @return Stack A clone of the current thread's diagnostic context.
- */
- public static Stack cloneStack() {
- return org.apache.logging.log4j.ThreadContext.cloneStack();
- }
-
-
- /**
- * Inherit the diagnostic context of another thread.
- * <p/>
- * <p>The parent thread can obtain a reference to its diagnostic
- * context using the {@link #cloneStack} method. It should
- * communicate this information to its child so that it may inherit
- * the parent's diagnostic context.
- * <p/>
- * <p>The parent's diagnostic context is cloned before being
- * inherited. In other words, once inherited, the two diagnostic
- * contexts can be managed independently.
- * <p/>
- * <p>In java, a child thread cannot obtain a reference to its
- * parent, unless it is directly handed the reference. Consequently,
- * there is no client-transparent way of inheriting diagnostic
- * contexts. Do you know any solution to this problem?
- *
- * @param stack The diagnostic context of the parent thread.
- */
- public static void inherit(Stack stack) {
- org.apache.logging.log4j.ThreadContext.setStack(stack);
- }
-
-
- /**
- * <font color="#FF4040"><b>Never use this method directly.</b>
- * @return The string value of the specified key.
- */
- public static String get() {
- return org.apache.logging.log4j.ThreadContext.peek();
- }
-
- /**
- * Get the current nesting depth of this diagnostic context.
- * @return int The number of elements in the call stack.
- * @see #setMaxDepth
- */
- public static int getDepth() {
- return org.apache.logging.log4j.ThreadContext.getDepth();
- }
-
- /**
- * Clients should call this method before leaving a diagnostic
- * context.
- * <p/>
- * <p>The returned value is the value that was pushed last. If no
- * context is available, then the empty string "" is returned.
- *
- * @return String The innermost diagnostic context.
- */
- public static String pop() {
- return org.apache.logging.log4j.ThreadContext.pop();
- }
-
- /**
- * Looks at the last diagnostic context at the top of this NDC
- * without removing it.
- * <p/>
- * <p>The returned value is the value that was pushed last. If no
- * context is available, then the empty string "" is returned.
- *
- * @return String The innermost diagnostic context.
- */
- public static String peek() {
- return org.apache.logging.log4j.ThreadContext.peek();
- }
-
- /**
- * Push new diagnostic context information for the current thread.
- * <p/>
- * <p>The contents of the <code>message</code> parameter is
- * determined solely by the client.
- *
- * @param message The new diagnostic context information.
- */
- public static void push(String message) {
- org.apache.logging.log4j.ThreadContext.push(message);
- }
-
- /**
- * Remove the diagnostic context for this thread.
- * <p/>
- * <p>Each thread that created a diagnostic context by calling
- * {@link #push} should call this method before exiting. Otherwise,
- * the memory used by the <b>thread</b> cannot be reclaimed by the
- * VM.
- * <p/>
- * <p>As this is such an important problem in heavy duty systems and
- * because it is difficult to always guarantee that the remove
- * method is called before exiting a thread, this method has been
- * augmented to lazily remove references to dead threads. In
- * practice, this means that you can be a little sloppy and
- * occasionally forget to call {@link #remove} before exiting a
- * thread. However, you must call <code>remove</code> sometime. If
- * you never call it, then your application is sure to run out of
- * memory.
- */
- public static void remove() {
- org.apache.logging.log4j.ThreadContext.removeStack();
- }
-
- /**
- * Set maximum depth of this diagnostic context. If the current
- * depth is smaller or equal to <code>maxDepth</code>, then no
- * action is taken.
- * <p/>
- * <p>This method is a convenient alternative to multiple {@link
- * #pop} calls. Moreover, it is often the case that at the end of
- * complex call sequences, the depth of the NDC is
- * unpredictable. The <code>setMaxDepth</code> method circumvents
- * this problem.
- * <p/>
- * <p>For example, the combination
- * <pre>
- * void foo() {
- * int depth = NDC.getDepth();
- * <p/>
- * ... complex sequence of calls
- * <p/>
- * NDC.setMaxDepth(depth);
- * }
- * </pre>
- * <p/>
- * ensures that between the entry and exit of foo the depth of the
- * diagnostic stack is conserved.
- *
- * @see #getDepth
- * @param maxDepth The maximum depth of the stack.
- */
- public static void setMaxDepth(int maxDepth) {
- org.apache.logging.log4j.ThreadContext.setMaxDepth(maxDepth);
- }
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Priority.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/Priority.java
deleted file mode 100644
index c17123e..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/Priority.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-/**
- * <font color="#AA4444">Refrain from using this class directly, use
- * the {@link Level} class instead</font>.
- */
-public class Priority {
-
- /**
- * The <code>OFF</code> has the highest possible rank and is
- * intended to turn off logging.
- */
- public static final int OFF_INT = Integer.MAX_VALUE;
- /**
- * The <code>FATAL</code> level designates very severe error
- * events that will presumably lead the application to abort.
- */
- public static final int FATAL_INT = 50000;
- /**
- * The <code>ERROR</code> level designates error events that
- * might still allow the application to continue running.
- */
- public static final int ERROR_INT = 40000;
- /**
- * The <code>WARN</code> level designates potentially harmful situations.
- */
- public static final int WARN_INT = 30000;
- /**
- * The <code>INFO</code> level designates informational messages
- * that highlight the progress of the application at coarse-grained
- * level.
- */
- public static final int INFO_INT = 20000;
- /**
- * The <code>DEBUG</code> Level designates fine-grained
- * informational events that are most useful to debug an
- * application.
- */
- public static final int DEBUG_INT = 10000;
- //public final static int FINE_INT = DEBUG_INT;
- /**
- * The <code>ALL</code> has the lowest possible rank and is intended to
- * turn on all logging.
- */
- public static final int ALL_INT = Integer.MIN_VALUE;
-
- /**
- * @deprecated Use {@link Level#FATAL} instead.
- */
- public static final Priority FATAL = new Level(FATAL_INT, "FATAL", 0);
-
- /**
- * @deprecated Use {@link Level#ERROR} instead.
- */
- public static final Priority ERROR = new Level(ERROR_INT, "ERROR", 3);
-
- /**
- * @deprecated Use {@link Level#WARN} instead.
- */
- public static final Priority WARN = new Level(WARN_INT, "WARN", 4);
-
- /**
- * @deprecated Use {@link Level#INFO} instead.
- */
- public static final Priority INFO = new Level(INFO_INT, "INFO", 6);
-
- /**
- * @deprecated Use {@link Level#DEBUG} instead.
- */
- public static final Priority DEBUG = new Level(DEBUG_INT, "DEBUG", 7);
-
- /*
- * These variables should be private but were not in Log4j 1.2 so are left the same way here.
- */
- transient int level;
- transient String levelStr;
- transient int syslogEquivalent;
-
- /**
- * Default constructor for deserialization.
- */
- protected Priority() {
- level = DEBUG_INT;
- levelStr = "DEBUG";
- syslogEquivalent = 7;
- }
-
- /**
- * Instantiate a level object.
- * @param level The level value.
- * @param levelStr The level name.
- * @param syslogEquivalent The equivalent syslog value.
- */
- protected Priority(int level, String levelStr, int syslogEquivalent) {
- this.level = level;
- this.levelStr = levelStr;
- this.syslogEquivalent = syslogEquivalent;
- }
-
- /**
- * Two priorities are equal if their level fields are equal.
- * @param o The Object to check.
- * @return true if the objects are equal, false otherwise.
- *
- * @since 1.2
- */
- public boolean equals(Object o) {
- if (o instanceof Priority) {
- Priority r = (Priority) o;
- return (this.level == r.level);
- } else {
- return false;
- }
- }
-
- /**
- * Return the syslog equivalent of this priority as an integer.
- * @return The equivalent syslog value.
- */
- public
- final int getSyslogEquivalent() {
- return syslogEquivalent;
- }
-
-
- /**
- * Returns <code>true</code> if this level has a higher or equal
- * level than the level passed as argument, <code>false</code>
- * otherwise.
- * <p/>
- * <p>You should think twice before overriding the default
- * implementation of <code>isGreaterOrEqual</code> method.
- * @param r The Priority to check.
- * @return true if the current level is greater or equal to the specified Priority.
- */
- public boolean isGreaterOrEqual(Priority r) {
- return level >= r.level;
- }
-
- /**
- * Return all possible priorities as an array of Level objects in
- * descending order.
- * @return An array of all possible Priorities.
- *
- * @deprecated This method will be removed with no replacement.
- */
- public static Priority[] getAllPossiblePriorities() {
- return new Priority[]{Priority.FATAL, Priority.ERROR, Level.WARN,
- Priority.INFO, Priority.DEBUG};
- }
-
-
- /**
- * Returns the string representation of this priority.
- * @return The name of the Priority.
- */
- public final String toString() {
- return levelStr;
- }
-
- /**
- * Returns the integer representation of this level.
- * @return The integer value of this level.
- */
- public final int toInt() {
- return level;
- }
-
- /**
- * @param sArg The name of the Priority.
- * @return The Priority matching the name.
- * @deprecated Please use the {@link Level#toLevel(String)} method instead.
- */
- public static Priority toPriority(String sArg) {
- return Level.toLevel(sArg);
- }
-
- /**
- * @param val The value of the Priority.
- * @return The Priority matching the value.
- * @deprecated Please use the {@link Level#toLevel(int)} method instead.
- */
- public static Priority toPriority(int val) {
- return toPriority(val, Priority.DEBUG);
- }
-
- /**
- * @param val The value of the Priority.
- * @param defaultPriority The default Priority to use if the value is invalid.
- * @return The Priority matching the value or the default Priority if no match is found.
- * @deprecated Please use the {@link Level#toLevel(int, Level)} method instead.
- */
- public static Priority toPriority(int val, Priority defaultPriority) {
- return Level.toLevel(val, (Level) defaultPriority);
- }
-
- /**
- * @param sArg The name of the Priority.
- * @param defaultPriority The default Priority to use if the name is not found.
- * @return The Priority matching the name or the default Priority if no match is found.
- * @deprecated Please use the {@link Level#toLevel(String, Level)} method instead.
- */
- public static Priority toPriority(String sArg, Priority defaultPriority) {
- return Level.toLevel(sArg, (Level) defaultPriority);
- }
-}
diff --git a/rgoers/log4j12-api/src/main/java/org/apache/log4j/package-info.java b/rgoers/log4j12-api/src/main/java/org/apache/log4j/package-info.java
deleted file mode 100644
index 714c200..0000000
--- a/rgoers/log4j12-api/src/main/java/org/apache/log4j/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-/**
- * Log4j 1.x compatibility layer.
- */
-package org.apache.log4j;
diff --git a/rgoers/log4j12-api/src/site/site.xml b/rgoers/log4j12-api/src/site/site.xml
deleted file mode 100644
index 832d7b8..0000000
--- a/rgoers/log4j12-api/src/site/site.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project name="Component">
- <bannerLeft>
- <name>Logging Services</name>
- <src>../images/ls-logo.jpg</src>
- <href>../index.html</href>
- </bannerLeft>
- <bannerRight>
- <src>../images/logo.jpg</src>
- </bannerRight>
- <body>
- <links>
- <item name="Apache" href="http://www.apache.org/" />
- <item name="Logging Services" href="http://logging.apache.org/"/>
- <item name="Log4j" href="../index.html"/>
- </links>
- <menu ref="reports"/>
- </body>
-</project>
diff --git a/rgoers/log4j12-api/src/site/xdoc/api.xml b/rgoers/log4j12-api/src/site/xdoc/api.xml
deleted file mode 100644
index d0a60fb..0000000
--- a/rgoers/log4j12-api/src/site/xdoc/api.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
- <properties>
- <title>Log4J 1.2 Bridge</title>
- <author email="rgoers@apache.org">Ralph Goers</author>
- </properties>
-
- <body>
- <section name="Log4J 1.2 Bridge">
-
- <p>
- The Log4Jj 2.0 API provides the interface that applications should code to and provides the
- adapter components required for implementers to create a logging implementation.
- </p>
-
- </section>
-
- <section name="Requirements">
- <p>
- The Log4j 2.0 API requires at least Java 5.
- </p>
- </section>
-
- </body>
-</document>
\ No newline at end of file
diff --git a/rgoers/log4j12-api/src/site/xdoc/index.xml b/rgoers/log4j12-api/src/site/xdoc/index.xml
deleted file mode 100644
index a35b531..0000000
--- a/rgoers/log4j12-api/src/site/xdoc/index.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
- <properties>
- <title>Log4J 1.2 Bridge</title>
- <author email="rgoers@apache.org">Ralph Goers</author>
- </properties>
-
- <body>
- <section name="Log4J 1.2 Bridge">
-
- <p>
- The Log4j 1.2 Bridge allows applications coded to use Log4j 1.2 API to use
- Log4j 2.0 instead.
- </p>
-
- </section>
-
- <section name="Requirements">
- <p>
- The Log4j 1.2 bridge requires at least Java 5.
- </p>
- </section>
-
- </body>
-</document>
\ No newline at end of file
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java
deleted file mode 100644
index 65b94d7..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/BasicConfigurationFactory.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.log4j;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.core.config.BaseConfiguration;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.xml.sax.InputSource;
-
-import java.net.URI;
-
-/**
- *
- */
-public class BasicConfigurationFactory extends ConfigurationFactory {
-
- @Override
- public String[] getSupportedTypes() {
- return new String[] {"*"};
- }
-
- @Override
- public Configuration getConfiguration(InputSource source) {
- return new BasicConfiguration();
- }
-
- @Override
- public Configuration getConfiguration(String name, URI configLocation) {
- return new BasicConfiguration();
- }
-
- public class BasicConfiguration extends BaseConfiguration {
-
- private static final String DEFAULT_LEVEL = "org.apache.logging.log4j.level";
-
- public BasicConfiguration() {
-
- LoggerConfig root = getRootLogger();
- String l = System.getProperty(DEFAULT_LEVEL);
- Level level = (l != null && Level.valueOf(l) != null) ? Level.valueOf(l) : Level.DEBUG;
- root.setLevel(level);
- }
- }
-}
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
deleted file mode 100644
index 8c081e8..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/CategoryTest.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j;
-
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.status.StatusConsoleListener;
-import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.apache.logging.log4j.core.layout.PatternLayout;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-
-/**
- * Tests of Category.
- */
-public class CategoryTest {
-
- static ConfigurationFactory cf = new BasicConfigurationFactory();
-
- private ListAppender appender = new ListAppender("List");
-
- @BeforeClass
- public static void setupClass() {
- ConfigurationFactory.setConfigurationFactory(cf);
- LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
- ctx.reconfigure();
- }
-
- @AfterClass
- public static void cleanupClass() {
- ConfigurationFactory.removeConfigurationFactory(cf);
- }
-
- /**
- * Tests Category.forcedLog.
- */
- @Test
- public void testForcedLog() {
- MockCategory category = new MockCategory("org.example.foo");
- category.setAdditivity(false);
- category.getLogger().addAppender(appender);
- category.info("Hello, World");
- int events = appender.getEvents().size();
- assertTrue("Number of events should be 1, was " + events, events == 1);
- appender.clear();
- }
-
- /**
- * Tests that the return type of getChainedPriority is Priority.
- *
- * @throws Exception thrown if Category.getChainedPriority can not be found.
- */
- @Test
- public void testGetChainedPriorityReturnType() throws Exception {
- Method method = Category.class.getMethod("getChainedPriority", (Class[]) null);
- assertTrue(method.getReturnType() == Priority.class);
- }
-
- /**
- * Tests l7dlog(Priority, String, Throwable).
- */
- @Test
- public void testL7dlog() {
- Logger logger = Logger.getLogger("org.example.foo");
- logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
- logger.l7dlog(debug, "Hello, World", null);
- assertTrue(appender.getEvents().size() == 0);
- }
-
- /**
- * Tests l7dlog(Priority, String, Object[], Throwable).
- */
- @Test
- public void testL7dlog4Param() {
- Logger logger = Logger.getLogger("org.example.foo");
- logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
- logger.l7dlog(debug, "Hello, World", new Object[0], null);
- assertTrue(appender.getEvents().size() == 0);
- }
-
- /**
- * Test using a pre-existing log4j2 logger
- */
- @Test
- public void testExistingLog4j2Logger() {
- // create the logger using LogManager
- org.apache.logging.log4j.LogManager.getLogger("existingLogger");
- // Logger will be the one created above
- Logger logger = Logger.getLogger("existingLogger");
- Logger l2 = LogManager.getLogger("existingLogger");
- assertEquals(logger, l2);
- logger.setLevel(Level.ERROR);
- Priority debug = Level.DEBUG;
- // the next line will throw an exception if the LogManager loggers
- // aren't supported by 1.2 Logger/Category
- logger.l7dlog(debug, "Hello, World", new Object[0], null);
- assertTrue(appender.getEvents().size() == 0);
- }
-
- /**
- * Tests setPriority(Priority).
- *
- * @deprecated
- */
- @Test
- public void testSetPriority() {
- Logger logger = Logger.getLogger("org.example.foo");
- Priority debug = Level.DEBUG;
- logger.setPriority(debug);
- }
-
- @Test
- public void testClassName() {
- Category category = Category.getInstance("TestCategory");
- Layout layout = PatternLayout.createLayout("%d %p %C{1.} [%t] %m%n", null, null, null);
- ListAppender appender = new ListAppender("List2", null, layout, false, false);
- appender.start();
- category.setAdditivity(false);
- category.getLogger().addAppender(appender);
- category.error("Test Message");
- List<String> msgs = appender.getMessages();
- assertTrue("Incorrect number of messages. Expected 1 got " + msgs.size(), msgs.size() == 1);
- String msg = msgs.get(0);
- appender.clear();
- String expected = "ERROR o.a.l.CategoryTest [main] Test Message\n";
- assertTrue("Incorrect message \"" + msg + "\"" + " expected \"" + expected +"\"", msg.endsWith(expected));
- }
-
- /**
- * Derived category to check method signature of forcedLog.
- */
- private static class MockCategory extends Logger {
- /**
- * Create new instance of MockCategory.
- *
- * @param name category name
- */
- public MockCategory(final String name) {
- super(name);
- }
-
- /**
- * Request an info level message.
- *
- * @param msg message
- */
- public void info(final String msg) {
- Priority info = Level.INFO;
- forcedLog(MockCategory.class.toString(), info, msg, null);
- }
- }
-}
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java
deleted file mode 100644
index 12e9212..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/LevelTest.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j;
-
-import org.apache.log4j.util.SerializationTestHelper;
-
-import java.util.Locale;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.junit.Assert;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-
-/**
- * Tests of Level.
- *
- * @author Curt Arnold
- * @since 1.2.12
- */
-public class LevelTest {
-
- /**
- * Serialize Level.INFO and check against witness.
- *
- * @throws Exception if exception during test.
- */
- @Test
- public void testSerializeINFO() throws Exception {
- int[] skip = new int[]{};
- SerializationTestHelper.assertSerializationEquals(
- "target/test-classes/witness/serialization/info.bin",
- Level.INFO, skip, Integer.MAX_VALUE);
- }
-
- /**
- * Deserialize witness and see if resolved to Level.INFO.
- *
- * @throws Exception if exception during test.
- */
- @Test
- public void testDeserializeINFO() throws Exception {
- Object obj =
- SerializationTestHelper.deserializeStream(
- "target/test-classes/witness/serialization/info.bin");
- assertTrue(obj instanceof Level);
- Level info = (Level) obj;
- assertEquals("INFO", info.toString());
- //
- // JDK 1.1 doesn't support readResolve necessary for the assertion
- if (!System.getProperty("java.version").startsWith("1.1.")) {
- assertTrue(obj == Level.INFO);
- }
- }
-
- /**
- * Tests that a custom level can be serialized and deserialized
- * and is not resolved to a stock level.
- *
- * @throws Exception if exception during test.
- */
- @Test
- public void testCustomLevelSerialization() throws Exception {
- CustomLevel custom = new CustomLevel();
- Object obj = SerializationTestHelper.serializeClone(custom);
- assertTrue(obj instanceof CustomLevel);
-
- CustomLevel clone = (CustomLevel) obj;
- assertEquals(Level.INFO.level, clone.level);
- assertEquals(Level.INFO.levelStr, clone.levelStr);
- assertEquals(Level.INFO.syslogEquivalent, clone.syslogEquivalent);
- }
-
- /**
- * Custom level to check that custom levels are
- * serializable, but not resolved to a plain Level.
- */
- private static class CustomLevel extends Level {
- /**
- * Create an instance of CustomLevel.
- */
- public CustomLevel() {
- super(
- Level.INFO.level, Level.INFO.levelStr, Level.INFO.syslogEquivalent);
- }
- }
-
- /**
- * Tests Level.TRACE_INT.
- */
- @Test
- public void testTraceInt() {
- assertEquals(5000, Level.TRACE_INT);
- }
-
- /**
- * Tests Level.TRACE.
- */
- @Test
- public void testTrace() {
- assertEquals("TRACE", Level.TRACE.toString());
- assertEquals(5000, Level.TRACE.toInt());
- assertEquals(7, Level.TRACE.getSyslogEquivalent());
- }
-
- /**
- * Tests Level.toLevel(Level.TRACE_INT).
- */
- @Test
- public void testIntToTrace() {
- Level trace = Level.toLevel(5000);
- assertEquals("TRACE", trace.toString());
- }
-
- /**
- * Tests Level.toLevel("TRACE");
- */
- @Test
- public void testStringToTrace() {
- Level trace = Level.toLevel("TRACE");
- assertEquals("TRACE", trace.toString());
- }
-
- /**
- * Tests that Level extends Priority.
- */
- @Test
- public void testLevelExtendsPriority() {
- assertTrue(Priority.class.isAssignableFrom(Level.class));
- }
-
- /**
- * Tests Level.OFF.
- */
- @Test
- public void testOFF() {
- assertTrue(Level.OFF instanceof Level);
- }
-
- /**
- * Tests Level.FATAL.
- */
- @Test
- public void testFATAL() {
- assertTrue(Level.FATAL instanceof Level);
- }
-
- /**
- * Tests Level.ERROR.
- */
- @Test
- public void testERROR() {
- assertTrue(Level.ERROR instanceof Level);
- }
-
- /**
- * Tests Level.WARN.
- */
- @Test
- public void testWARN() {
- assertTrue(Level.WARN instanceof Level);
- }
-
- /**
- * Tests Level.INFO.
- */
- @Test
- public void testINFO() {
- assertTrue(Level.INFO instanceof Level);
- }
-
- /**
- * Tests Level.DEBUG.
- */
- @Test
- public void testDEBUG() {
- assertTrue(Level.DEBUG instanceof Level);
- }
-
- /**
- * Tests Level.TRACE.
- */
- @Test
- public void testTRACE() {
- assertTrue(Level.TRACE instanceof Level);
- }
-
- /**
- * Tests Level.ALL.
- */
- @Test
- public void testALL() {
- assertTrue(Level.ALL instanceof Level);
- }
-
- /**
- * Tests Level.toLevel(Level.All_INT).
- */
- @Test
- public void testIntToAll() {
- Level level = Level.toLevel(Level.ALL_INT);
- assertEquals("ALL", level.toString());
- }
-
- /**
- * Tests Level.toLevel(Level.FATAL_INT).
- */
- @Test
- public void testIntToFatal() {
- Level level = Level.toLevel(Level.FATAL_INT);
- assertEquals("FATAL", level.toString());
- }
-
-
- /**
- * Tests Level.toLevel(Level.OFF_INT).
- */
- @Test
- public void testIntToOff() {
- Level level = Level.toLevel(Level.OFF_INT);
- assertEquals("OFF", level.toString());
- }
-
- /**
- * Tests Level.toLevel(17, Level.FATAL).
- */
- @Test
- public void testToLevelUnrecognizedInt() {
- Level level = Level.toLevel(17, Level.FATAL);
- assertEquals("FATAL", level.toString());
- }
-
- /**
- * Tests Level.toLevel(null, Level.FATAL).
- */
- @Test
- public void testToLevelNull() {
- Level level = Level.toLevel(null, Level.FATAL);
- assertEquals("FATAL", level.toString());
- }
-
- /**
- * Test that dotless lower I + "nfo" is recognized as INFO.
- */
- @Test
- public void testDotlessLowerI() {
- Level level = Level.toLevel("\u0131nfo");
- assertEquals("INFO", level.toString());
- }
-
- /**
- * Test that dotted lower I + "nfo" is recognized as INFO
- * even in Turkish locale.
- */
- @Test
- public void testDottedLowerI() {
- Locale defaultLocale = Locale.getDefault();
- Locale turkey = new Locale("tr", "TR");
- Locale.setDefault(turkey);
- Level level = Level.toLevel("info");
- Locale.setDefault(defaultLocale);
- assertEquals("INFO", level.toString());
- }
-
-
-}
-
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
deleted file mode 100644
index 8202e9d..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/LoggerTest.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j;
-
-import org.apache.logging.log4j.core.Appender;
-
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.apache.logging.log4j.core.appender.AppenderBase;
-import org.apache.logging.log4j.test.appender.ListAppender;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertSame;
-
-/**
- * Used for internal unit testing the Logger class.
- */
-public class LoggerTest {
-
- Logger logger;
- Appender a1;
- Appender a2;
-
- static ResourceBundle rbUS;
- static ResourceBundle rbFR;
- static ResourceBundle rbCH;
-
- // A short message.
- static String MSG = "M";
-
- static ConfigurationFactory cf = new BasicConfigurationFactory();
-
- @BeforeClass
- public static void setUpClass() {
- rbUS = ResourceBundle.getBundle("L7D", new Locale("en", "US"));
- assertNotNull(rbUS);
-
- rbFR = ResourceBundle.getBundle("L7D", new Locale("fr", "FR"));
- assertNotNull("Got a null resource bundle.", rbFR);
-
- rbCH = ResourceBundle.getBundle("L7D", new Locale("fr", "CH"));
- assertNotNull("Got a null resource bundle.", rbCH);
-
- ConfigurationFactory.setConfigurationFactory(cf);
- }
-
- @AfterClass
- public static void tearDownClass() {
- }
-
- @After
- public void tearDown() {
- LoggerContext ctx = (LoggerContext) org.apache.logging.log4j.LogManager.getContext();
- ctx.reconfigure();
- a1 = null;
- a2 = null;
- }
-
- /**
- * Add an appender and see if it can be retrieved.
- * Skipping this test as the Appender interface isn't compatible with legacy Log4j.
- public void testAppender1() {
- logger = Logger.getLogger("test");
- a1 = new ListAppender("testAppender1");
- logger.addAppender(a1);
-
- Enumeration enumeration = logger.getAllAppenders();
- Appender aHat = (Appender) enumeration.nextElement();
- assertEquals(a1, aHat);
- } */
-
- /**
- * Add an appender X, Y, remove X and check if Y is the only
- * remaining appender.
- * Skipping this test as the Appender interface isn't compatible with legacy Log4j.
- public void testAppender2() {
- a1 = new FileAppender();
- a1.setName("testAppender2.1");
- a2 = new FileAppender();
- a2.setName("testAppender2.2");
-
- logger = Logger.getLogger("test");
- logger.addAppender(a1);
- logger.addAppender(a2);
- logger.removeAppender("testAppender2.1");
- Enumeration enumeration = logger.getAllAppenders();
- Appender aHat = (Appender) enumeration.nextElement();
- assertEquals(a2, aHat);
- assertTrue(!enumeration.hasMoreElements());
- } */
-
- /**
- * Test if logger a.b inherits its appender from a.
- */
- @Test
- public void testAdditivity1() {
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- CountingAppender ca = new CountingAppender();
- a.getLogger().addAppender(ca);
-
- assertEquals(ca.counter, 0);
- ab.debug(MSG);
- assertEquals(ca.counter, 1);
- ab.info(MSG);
- assertEquals(ca.counter, 2);
- ab.warn(MSG);
- assertEquals(ca.counter, 3);
- ab.error(MSG);
- assertEquals(ca.counter, 4);
- }
-
- /**
- * Test multiple additivity.
- */
- @Test
- public void testAdditivity2() {
-
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- Logger abc = Logger.getLogger("a.b.c");
- Logger x = Logger.getLogger("x");
-
- CountingAppender ca1 = new CountingAppender();
- CountingAppender ca2 = new CountingAppender();
-
- a.getLogger().addAppender(ca1);
- abc.getLogger().addAppender(ca2);
-
- assertEquals(ca1.counter, 0);
- assertEquals(ca2.counter, 0);
-
- ab.debug(MSG);
- assertEquals(ca1.counter, 1);
- assertEquals(ca2.counter, 0);
-
- abc.debug(MSG);
- assertEquals(ca1.counter, 2);
- assertEquals(ca2.counter, 1);
-
- x.debug(MSG);
- assertEquals(ca1.counter, 2);
- assertEquals(ca2.counter, 1);
- }
-
- /**
- * Test additivity flag.
- */
- @Test
- public void testAdditivity3() {
-
- Logger root = Logger.getRootLogger();
- Logger a = Logger.getLogger("a");
- Logger ab = Logger.getLogger("a.b");
- Logger abc = Logger.getLogger("a.b.c");
- Logger x = Logger.getLogger("x");
-
- CountingAppender caRoot = new CountingAppender();
- CountingAppender caA = new CountingAppender();
- CountingAppender caABC = new CountingAppender();
-
- root.getLogger().addAppender(caRoot);
- a.getLogger().addAppender(caA);
- abc.getLogger().addAppender(caABC);
-
- assertEquals(caRoot.counter, 0);
- assertEquals(caA.counter, 0);
- assertEquals(caABC.counter, 0);
-
- ab.setAdditivity(false);
-
-
- a.debug(MSG);
- assertEquals(caRoot.counter, 1);
- assertEquals(caA.counter, 1);
- assertEquals(caABC.counter, 0);
-
- ab.debug(MSG);
- assertEquals(caRoot.counter, 1);
- assertEquals(caA.counter, 1);
- assertEquals(caABC.counter, 0);
-
- abc.debug(MSG);
- assertEquals(caRoot.counter, 1);
- assertEquals(caA.counter, 1);
- assertEquals(caABC.counter, 1);
- }
-
- /* Don't support getLoggerRepository
- public void testDisable1() {
- CountingAppender caRoot = new CountingAppender();
- Logger root = Logger.getRootLogger();
- root.getLogger().addAppender(caRoot);
-
- LoggerRepository h = LogManager.getLoggerRepository();
- //h.disableDebug();
- h.setThreshold((Level) Level.INFO);
- assertEquals(caRoot.counter, 0);
-
- root.debug(MSG);
- assertEquals(caRoot.counter, 0);
- root.info(MSG);
- assertEquals(caRoot.counter, 1);
- root.log(Level.WARN, MSG);
- assertEquals(caRoot.counter, 2);
- root.warn(MSG);
- assertEquals(caRoot.counter, 3);
-
- //h.disableInfo();
- h.setThreshold((Level) Level.WARN);
- root.debug(MSG);
- assertEquals(caRoot.counter, 3);
- root.info(MSG);
- assertEquals(caRoot.counter, 3);
- root.log(Level.WARN, MSG);
- assertEquals(caRoot.counter, 4);
- root.error(MSG);
- assertEquals(caRoot.counter, 5);
- root.log(Level.ERROR, MSG);
- assertEquals(caRoot.counter, 6);
-
- //h.disableAll();
- h.setThreshold(Level.OFF);
- root.debug(MSG);
- assertEquals(caRoot.counter, 6);
- root.info(MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.WARN, MSG);
- assertEquals(caRoot.counter, 6);
- root.error(MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.FATAL, MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.FATAL, MSG);
- assertEquals(caRoot.counter, 6);
-
- //h.disable(Level.FATAL);
- h.setThreshold(Level.OFF);
- root.debug(MSG);
- assertEquals(caRoot.counter, 6);
- root.info(MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.WARN, MSG);
- assertEquals(caRoot.counter, 6);
- root.error(MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.ERROR, MSG);
- assertEquals(caRoot.counter, 6);
- root.log(Level.FATAL, MSG);
- assertEquals(caRoot.counter, 6);
- } */
-
- @Test
- public void testRB1() {
- Logger root = Logger.getRootLogger();
- root.setResourceBundle(rbUS);
- ResourceBundle t = root.getResourceBundle();
- assertSame(t, rbUS);
-
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
-
- t = x.getResourceBundle();
- assertSame(t, rbUS);
- t = x_y.getResourceBundle();
- assertSame(t, rbUS);
- t = x_y_z.getResourceBundle();
- assertSame(t, rbUS);
- }
-
- @Test
- public void testRB2() {
- Logger root = Logger.getRootLogger();
- root.setResourceBundle(rbUS);
- ResourceBundle t = root.getResourceBundle();
- assertTrue(t == rbUS);
-
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
-
- x_y.setResourceBundle(rbFR);
- t = x.getResourceBundle();
- assertSame(t, rbUS);
- t = x_y.getResourceBundle();
- assertSame(t, rbFR);
- t = x_y_z.getResourceBundle();
- assertSame(t, rbFR);
- }
-
- @Test
- public void testRB3() {
- Logger root = Logger.getRootLogger();
- root.setResourceBundle(rbUS);
- ResourceBundle t = root.getResourceBundle();
- assertTrue(t == rbUS);
-
- Logger x = Logger.getLogger("x");
- Logger x_y = Logger.getLogger("x.y");
- Logger x_y_z = Logger.getLogger("x.y.z");
-
- x_y.setResourceBundle(rbFR);
- x_y_z.setResourceBundle(rbCH);
- t = x.getResourceBundle();
- assertSame(t, rbUS);
- t = x_y.getResourceBundle();
- assertSame(t, rbFR);
- t = x_y_z.getResourceBundle();
- assertSame(t, rbCH);
- }
-
- @Test
- public void testExists() {
- Logger a = Logger.getLogger("a");
- Logger a_b = Logger.getLogger("a.b");
- Logger a_b_c = Logger.getLogger("a.b.c");
-
- Logger t;
- t = LogManager.exists("xx");
- assertNull(t);
- t = LogManager.exists("a");
- assertSame(a, t);
- t = LogManager.exists("a.b");
- assertSame(a_b, t);
- t = LogManager.exists("a.b.c");
- assertSame(a_b_c, t);
- }
- /* Don't support hierarchy
- public void testHierarchy1() {
- Hierarchy h = new Hierarchy(new RootLogger((Level) Level.ERROR));
- Logger a0 = h.getLogger("a");
- assertEquals("a", a0.getName());
- assertNull(a0.getLevel());
- assertSame(Level.ERROR, a0.getEffectiveLevel());
-
- Logger a1 = h.getLogger("a");
- assertSame(a0, a1);
- } */
-
- /**
- * Tests logger.trace(Object).
- */
- @Test
- public void testTrace() {
- ListAppender appender = new ListAppender("List");
- appender.start();
- Logger root = Logger.getRootLogger();
- root.getLogger().addAppender(appender);
- root.setLevel(Level.INFO);
-
- Logger tracer = Logger.getLogger("com.example.Tracer");
- tracer.setLevel(Level.TRACE);
-
- tracer.trace("Message 1");
- root.trace("Discarded Message");
- root.trace("Discarded Message");
-
- List<LogEvent> msgs = appender.getEvents();
- assertEquals(1, msgs.size());
- LogEvent event = (LogEvent) msgs.get(0);
- assertEquals(org.apache.logging.log4j.Level.TRACE, event.getLevel());
- assertEquals("Message 1", event.getMessage().getMessageFormat());
- }
-
- /**
- * Tests logger.trace(Object, Exception).
- */
- @Test
- public void testTraceWithException() {
- ListAppender appender = new ListAppender("List");
- Logger root = Logger.getRootLogger();
- root.getLogger().addAppender(appender);
- root.setLevel(Level.INFO);
-
- Logger tracer = Logger.getLogger("com.example.Tracer");
- tracer.setLevel(Level.TRACE);
- NullPointerException ex = new NullPointerException();
-
- tracer.trace("Message 1", ex);
- root.trace("Discarded Message", ex);
- root.trace("Discarded Message", ex);
-
- List<LogEvent> msgs = appender.getEvents();
- assertEquals(1, msgs.size());
- LogEvent event = msgs.get(0);
- assertEquals(org.apache.logging.log4j.Level.TRACE, event.getLevel());
- assertEquals("Message 1", event.getMessage().getFormattedMessage());
- }
-
- /**
- * Tests isTraceEnabled.
- */
- @Test
- public void testIsTraceEnabled() {
- ListAppender appender = new ListAppender("List");
- Logger root = Logger.getRootLogger();
- root.getLogger().addAppender(appender);
- root.setLevel(Level.INFO);
-
- Logger tracer = Logger.getLogger("com.example.Tracer");
- tracer.setLevel(Level.TRACE);
-
- assertTrue(tracer.isTraceEnabled());
- assertFalse(root.isTraceEnabled());
- }
-
- private static class CountingAppender extends AppenderBase {
-
- int counter;
-
- CountingAppender() {
- super("Counter", null, null);
- counter = 0;
- }
-
- public void close() {
- }
-
- public void append(LogEvent event) {
- counter++;
- }
-
- public boolean requiresLayout() {
- return true;
- }
- }
-}
-
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java
deleted file mode 100644
index 97dd687..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/PriorityTest.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j;
-
-import java.util.Locale;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import org.junit.Assert;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-/**
- * Tests of Priority.
- *
- */
-public class PriorityTest {
-
- /**
- * Tests Priority.OFF_INT.
- */
- @Test
- public void testOffInt() {
- assertEquals(Integer.MAX_VALUE, Priority.OFF_INT);
- }
-
- /**
- * Tests Priority.FATAL_INT.
- */
- @Test
- public void testFatalInt() {
- assertEquals(50000, Priority.FATAL_INT);
- }
-
- /**
- * Tests Priority.ERROR_INT.
- */
- @Test
- public void testErrorInt() {
- assertEquals(40000, Priority.ERROR_INT);
- }
-
- /**
- * Tests Priority.WARN_INT.
- */
- @Test
- public void testWarnInt() {
- assertEquals(30000, Priority.WARN_INT);
- }
-
- /**
- * Tests Priority.INFO_INT.
- */
- @Test
- public void testInfoInt() {
- assertEquals(20000, Priority.INFO_INT);
- }
-
- /**
- * Tests Priority.DEBUG_INT.
- */
- @Test
- public void testDebugInt() {
- assertEquals(10000, Priority.DEBUG_INT);
- }
-
- /**
- * Tests Priority.ALL_INT.
- */
- @Test
- public void testAllInt() {
- assertEquals(Integer.MIN_VALUE, Priority.ALL_INT);
- }
-
- /**
- * Tests Priority.FATAL.
- *
- * @deprecated
- */
- @Test
- public void testFatal() {
- assertTrue(Priority.FATAL instanceof Level);
- }
-
- /**
- * Tests Priority.ERROR.
- *
- * @deprecated
- */
- @Test
- public void testERROR() {
- assertTrue(Priority.ERROR instanceof Level);
- }
-
- /**
- * Tests Priority.WARN.
- *
- * @deprecated
- */
- @Test
- public void testWARN() {
- assertTrue(Priority.WARN instanceof Level);
- }
-
- /**
- * Tests Priority.INFO.
- *
- * @deprecated
- */
- @Test
- public void testINFO() {
- assertTrue(Priority.INFO instanceof Level);
- }
-
- /**
- * Tests Priority.DEBUG.
- *
- * @deprecated
- */
- @Test
- public void testDEBUG() {
- assertTrue(Priority.DEBUG instanceof Level);
- }
-
- /**
- * Tests Priority.equals(null).
- *
- * @deprecated
- */
- @Test
- public void testEqualsNull() {
- assertFalse(Priority.DEBUG.equals(null));
- }
-
- /**
- * Tests Priority.equals(Level.DEBUG).
- *
- * @deprecated
- */
- @Test
- public void testEqualsLevel() {
- //
- // this behavior violates the equals contract.
- //
- assertTrue(Priority.DEBUG.equals(Level.DEBUG));
- }
-
- /**
- * Tests getAllPossiblePriorities().
- *
- * @deprecated
- */
- @Test
- public void testGetAllPossiblePriorities() {
- Priority[] priorities = Priority.getAllPossiblePriorities();
- assertEquals(5, priorities.length);
- }
-
- /**
- * Tests toPriority(String).
- *
- * @deprecated
- */
- @Test
- public void testToPriorityString() {
- assertTrue(Priority.toPriority("DEBUG") == Level.DEBUG);
- }
-
- /**
- * Tests toPriority(int).
- *
- * @deprecated
- */
- @Test
- public void testToPriorityInt() {
- assertTrue(Priority.toPriority(Priority.DEBUG_INT) == Level.DEBUG);
- }
-
- /**
- * Tests toPriority(String, Priority).
- *
- * @deprecated
- */
- @Test
- public void testToPriorityStringPriority() {
- assertTrue(Priority.toPriority("foo", Priority.DEBUG) == Priority.DEBUG);
- }
-
- /**
- * Tests toPriority(int, Priority).
- *
- * @deprecated
- */
- @Test
- public void testToPriorityIntPriority() {
- assertTrue(Priority.toPriority(17, Priority.DEBUG) == Priority.DEBUG);
- }
-
- /**
- * Test that dotless lower I + "nfo" is recognized as INFO.
- *
- * @deprecated
- */
- @Test
- public void testDotlessLowerI() {
- Priority level = Priority.toPriority("\u0131nfo");
- assertEquals("INFO", level.toString());
- }
-
- /**
- * Test that dotted lower I + "nfo" is recognized as INFO
- * even in Turkish locale.
- *
- * @deprecated
- */
- @Test
- public void testDottedLowerI() {
- Locale defaultLocale = Locale.getDefault();
- Locale turkey = new Locale("tr", "TR");
- Locale.setDefault(turkey);
- Priority level = Priority.toPriority("info");
- Locale.setDefault(defaultLocale);
- assertEquals("INFO", level.toString());
- }
-
-}
-
diff --git a/rgoers/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java b/rgoers/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
deleted file mode 100644
index 89feb33..0000000
--- a/rgoers/log4j12-api/src/test/java/org/apache/log4j/util/SerializationTestHelper.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.log4j.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.junit.Assert;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-
-/**
- * Utiities for serialization tests.
- */
-public class SerializationTestHelper {
- /**
- * Private constructor.
- */
- private SerializationTestHelper() {
- }
-
- /**
- * Creates a clone by serializing object and
- * deserializing byte stream.
- *
- * @param obj object to serialize and deserialize.
- * @return clone
- * @throws IOException on IO error.
- * @throws ClassNotFoundException if class not found.
- */
- public static Object serializeClone(final Object obj)
- throws IOException, ClassNotFoundException {
- ByteArrayOutputStream memOut = new ByteArrayOutputStream();
- ObjectOutputStream objOut = new ObjectOutputStream(memOut);
- objOut.writeObject(obj);
- objOut.close();
-
- ByteArrayInputStream src = new ByteArrayInputStream(memOut.toByteArray());
- ObjectInputStream objIs = new ObjectInputStream(src);
-
- return objIs.readObject();
- }
-
- /**
- * Deserializes a specified file.
- *
- * @param witness serialization file, may not be null.
- * @return deserialized object.
- * @throws Exception thrown on IO or deserialization exception.
- */
- public static Object deserializeStream(final String witness)
- throws Exception {
- FileInputStream fileIs = new FileInputStream(witness);
- ObjectInputStream objIs = new ObjectInputStream(fileIs);
-
- return objIs.readObject();
- }
-
- /**
- * Checks the serialization of an object against an file
- * containing the expected serialization.
- *
- * @param witness name of file containing expected serialization.
- * @param obj object to be serialized.
- * @param skip positions in serialized stream that should not be compared.
- * @param endCompare position to stop comparison.
- * @throws Exception thrown on IO or serialization exception.
- */
- public static void assertSerializationEquals(
- final String witness, final Object obj, final int[] skip,
- final int endCompare) throws Exception {
- ByteArrayOutputStream memOut = new ByteArrayOutputStream();
- ObjectOutputStream objOut = new ObjectOutputStream(memOut);
- objOut.writeObject(obj);
- objOut.close();
-
- assertStreamEquals(witness, memOut.toByteArray(), skip, endCompare);
- }
-
- /**
- * Asserts the serialized form of an object.
- *
- * @param witness file name of expected serialization.
- * @param actual byte array of actual serialization.
- * @param skip positions to skip comparison.
- * @param endCompare position to stop comparison.
- * @throws IOException thrown on IO or serialization exception.
- */
- public static void assertStreamEquals(
- final String witness, final byte[] actual, final int[] skip,
- final int endCompare) throws IOException {
- File witnessFile = new File(witness);
-
- if (witnessFile.exists()) {
- int skipIndex = 0;
- byte[] expected = new byte[actual.length];
- FileInputStream is = new FileInputStream(witnessFile);
- int bytesRead = is.read(expected);
- is.close();
-
- if (bytesRead < endCompare) {
- assertEquals(bytesRead, actual.length);
- }
-
- int endScan = actual.length;
-
- if (endScan > endCompare) {
- endScan = endCompare;
- }
-
- for (int i = 0; i < endScan; i++) {
- if ((skipIndex < skip.length) && (skip[skipIndex] == i)) {
- skipIndex++;
- } else {
- if (expected[i] != actual[i]) {
- assertEquals(
- "Difference at offset " + i, expected[i], actual[i]);
- }
- }
- }
- } else {
- //
- // if the file doesn't exist then
- // assume that we are setting up and need to write it
- FileOutputStream os = new FileOutputStream(witnessFile);
- os.write(actual);
- os.close();
- fail("Writing witness file " + witness);
- }
- }
-}
-
diff --git a/rgoers/log4j12-api/src/test/resources/L7D_en_US.properties b/rgoers/log4j12-api/src/test/resources/L7D_en_US.properties
deleted file mode 100644
index c3c2802..0000000
--- a/rgoers/log4j12-api/src/test/resources/L7D_en_US.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-test=This is the English, US test.
-hello_world=Hello world.
-msg1=This is test number {0} with string argument {1}.
diff --git a/rgoers/log4j12-api/src/test/resources/L7D_fr.properties b/rgoers/log4j12-api/src/test/resources/L7D_fr.properties
deleted file mode 100644
index 25b878a..0000000
--- a/rgoers/log4j12-api/src/test/resources/L7D_fr.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-test=Ceci est le test en francais pour la France.
-hello_world=Bonjour la France.
-msg1=Ceci est le test numero {0} contenant l''argument {1}.
diff --git a/rgoers/log4j12-api/src/test/resources/L7D_fr_CH.properties b/rgoers/log4j12-api/src/test/resources/L7D_fr_CH.properties
deleted file mode 100644
index ba9b1ff..0000000
--- a/rgoers/log4j12-api/src/test/resources/L7D_fr_CH.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-test=Ceci est le test en francais pour la p'tite Suisse.
-hello world=Salut le monde.
diff --git a/rgoers/log4j12-api/src/test/resources/witness/serialization/info.bin b/rgoers/log4j12-api/src/test/resources/witness/serialization/info.bin
deleted file mode 100644
index f887f39..0000000
--- a/rgoers/log4j12-api/src/test/resources/witness/serialization/info.bin
+++ /dev/null
Binary files differ
diff --git a/rgoers/log4j2-api/pom.xml b/rgoers/log4j2-api/pom.xml
deleted file mode 100644
index c5ab564..0000000
--- a/rgoers/log4j2-api/pom.xml
+++ /dev/null
@@ -1,164 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2</artifactId>
- <version>1.99.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-api</artifactId>
- <packaging>jar</packaging>
- <name>Log4J API</name>
- <description>The Log4J API</description>
- <properties>
- <log4j.parent.dir>${basedir}/..</log4j.parent.dir>
- </properties>
- <dependencies>
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.3.1</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-changes-plugin</artifactId>
- <version>2.6</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>changes-report</report>
- </reports>
- </reportSet>
- </reportSets>
- <configuration>
- <issueLinkTemplate>%URL%/show_bug.cgi?id=%ISSUE%</issueLinkTemplate>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.7</version>
- <configuration>
- <!--<propertiesLocation>${vfs.parent.dir}/checkstyle.properties</propertiesLocation> -->
- <configLocation>${log4j.parent.dir}/checkstyle.xml</configLocation>
- <suppressionsLocation>${log4j.parent.dir}/checkstyle-suppressions.xml</suppressionsLocation>
- <enableRulesSummary>false</enableRulesSummary>
- <propertyExpansion>basedir=${basedir}</propertyExpansion>
- <propertyExpansion>licensedir=${log4j.parent.dir}/checkstyle-header.txt</propertyExpansion>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating
- project -->
- <detectOfflineLinks>false</detectOfflineLinks>
- <linksource>true</linksource>
- <tags>
- <tag>
- <name>issue</name>
- <placement>a</placement>
- <head>JIRA issue:</head>
- </tag>
- <tag>
- <name>doubt</name>
- <placement>a</placement>
- <head>Troublesome:</head>
- </tag>
- <tag>
- <name>compare</name>
- <placement>a</placement>
- <head>Compare with:</head>
- </tag>
- </tags>
- </configuration>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>javadoc</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <threshold>Normal</threshold>
- <effort>Default</effort>
- <excludeFilterFile>${log4j.parent.dir}/findbugs-exclude-filter.xml</excludeFilterFile>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.3</version>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>jxr</report>
- </reports>
- </reportSet>
- <reportSet>
- <id>aggregate</id>
- <reports>
- <report>aggregate</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.2</version>
- <reportSets>
- <reportSet>
- <!-- Disabled at it kills the site generation via a NoClassDefFoundError -->
- <reports/>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
-</project>
-
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/EventLogger.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/EventLogger.java
deleted file mode 100644
index 3a047e3..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/EventLogger.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.message.StructuredDataMessage;
-import org.apache.logging.log4j.spi.AbstractLogger;
-import org.apache.logging.log4j.spi.AbstractLoggerWrapper;
-
-/**
- * Logs "Events" that are represented as StructuredDataMessages.
- */
-public final class EventLogger {
-
- /**
- * Define the Event Marker.
- */
- public static final Marker EVENT_MARKER = MarkerManager.getMarker("EVENT");
-
- private static final String FQCN = EventLogger.class.getName();
-
- private static AbstractLoggerWrapper logger;
-
- static {
- Logger l = LogManager.getLogger("EventLogger");
- if (!(l instanceof AbstractLogger)) {
- throw new LoggingException("Logger returned must be based on AbstractLogger");
- }
- logger = new AbstractLoggerWrapper((AbstractLogger) l, "EventLogger");
- }
-
-
- private EventLogger() {
- }
-
- /**
- * Log events with a level of ALL.
- * @param msg The event StructuredDataMessage.
- */
- public static void logEvent(StructuredDataMessage msg) {
- logger.log(EVENT_MARKER, FQCN, Level.OFF, msg, null);
- }
-
- /**
- * Log events and specify the logging level.
- * @param msg The event StructuredDataMessage.
- * @param level The logging Level.
- */
- public static void logEvent(StructuredDataMessage msg, Level level) {
- logger.log(EVENT_MARKER, FQCN, level, msg, null);
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java
deleted file mode 100644
index 4fd3115..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Level.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-/**
- * Levels used for identifying the severity of an event. Levels are organized from most specific to least:<br>
- * OFF (most specific)<br>
- * FATAL<br>
- * ERROR<br>
- * WARN<br>
- * INFO<br>
- * DEBUG<br>
- * TRACE<br>
- * AL (least specific)<br>
- *
- * Typically, configuring a level in a filter or on a logger will cause logging events of that level and those
- * that are more specific to pass through the filter.
- * A special level, ALL, is guaranteed to capture all levels when used in logging configurations.
- * @doubt see LOG4J-41
- */
-public enum Level {
- /**
- * No events will be logged.
- */
- OFF(0),
- /**
- * A severe error that will prevent the application from continuing.
- */
- FATAL(1),
- /**
- * An error in the application, possibly recoverable.
- */
- ERROR(2),
- /**
- * An event that might possible lead to an error.
- */
- WARN(3),
- /**
- * An event for informational purposes.
- */
- INFO(4),
- /**
- * A general debugging event.
- */
- DEBUG(5),
- /**
- * A fine-grained debug message, typically capturing the flow through the application.
- */
- TRACE(6),
- /**
- * All events should be logged.
- */
- ALL(Integer.MAX_VALUE);
-
- private final int intLevel;
-
- private Level(int val) {
- intLevel = val;
- }
-
- /**
- * Convert the string passed as argument to a level. If the
- * conversion fails, then this method returns {@link #DEBUG}.
- *
- * @param sArg The name of the desired Level.
- * @return The Level associated with the String.
- */
- public static Level toLevel(String sArg) {
- return toLevel(sArg, DEBUG);
- }
-
- /**
- * Convert the string passed as argument to a level. If the
- * conversion fails, then this method returns the value of
- * <code>defaultLevel</code>.
- *
- * @param sArg The name of the desired Level.
- * @param defaultLevel The Level to use if the String is invalid.
- * @return The LEvel associated with the String.
- */
- public static Level toLevel(String sArg, Level defaultLevel) {
- if (sArg == null) {
- return defaultLevel;
- }
- for (Level level : values()) {
- if (level.name().equals(sArg)) {
- return level;
- }
- }
- return defaultLevel;
- }
-
- /**
- * Compares this level against the level passed as an argument and returns true if this
- * level is the same or more specific.
- *
- * @param level The level to check.
- * @return True if the passed Level is more specific or the same as this Level.
- */
- public boolean isAtLeastAsSpecificAs(Level level) {
- return (intLevel <= level.intLevel);
- }
-
- /**
- * Compares this level against the level passed as an argument and returns true if this
- * level is the same or more specific.
- *
- * @param level The level to check.
- * @return True if the passed Level is more specific or the same as this Level.
- */
- public boolean isAtLeastAsSpecificAs(int level) {
- return (intLevel <= level);
- }
-
- /**
- * Compares the specified Level against this one.
- * @param level The level to check.
- * @return True if the passed Level is more specific or the same as this Level.
- */
- public boolean lessOrEqual(Level level) {
- return (intLevel <= level.intLevel);
- }
-
- /**
- * Compares the specified Level against this one.
- * @param level The level to check.
- * @return True if the passed Level is more specific or the same as this Level.
- */
- public boolean lessOrEqual(int level) {
- return (intLevel <= level);
- }
-
- /**
- * Returns the integer value of the Level.
- * @return the integer value of the Level.
- */
- public int intLevel() {
- return intLevel;
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LogManager.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LogManager.java
deleted file mode 100644
index 2c9f149..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LogManager.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.spi.LoggerContext;
-import org.apache.logging.log4j.spi.LoggerContextFactory;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * The anchor point for the logging system.
- */
-public class LogManager {
- /**
- * The name of the root Logger.
- */
- public static final String ROOT_LOGGER_NAME = "";
-
- private static final String LOGGER_RESOURCE = "META-INF/log4j-provider.xml";
- private static final String LOGGER_CONTEXT_FACTORY = "LoggerContextFactory";
- private static final String API_VERSION = "Log4jAPIVersion";
- private static final String[] COMPATIBLE_API_VERSIONS = {
- "1.99.0"
- };
-
- private static LoggerContextFactory factory;
-
- private static Logger logger = StatusLogger.getLogger();
-
- /**
- * Prevent instantiation
- */
- protected LogManager() {
- }
-
-
- /**
- * Scans the classpath to find all logging implementation. Currently, only one will
- * be used but this could be extended to allow multiple implementations to be used.
- */
- static {
- ClassLoader cl = findClassLoader();
- List<LoggerContextFactory> factories = new ArrayList<LoggerContextFactory>();
-
- Enumeration enumResources = null;
- try {
- enumResources = cl.getResources(LOGGER_RESOURCE);
- } catch (IOException e) {
- logger.fatal("Unable to locate " + LOGGER_RESOURCE, e);
- }
-
- if (enumResources != null) {
- while (enumResources.hasMoreElements()) {
- Properties props = new Properties();
- URL url = (URL) enumResources.nextElement();
- try {
- props.loadFromXML(url.openStream());
- } catch (IOException ioe) {
- logger.error("Unable to read " + url.toString(), ioe);
- }
- if (!validVersion(props.getProperty(API_VERSION))) {
- continue;
- }
- String className = props.getProperty(LOGGER_CONTEXT_FACTORY);
- if (className != null) {
- try {
- Class clazz = cl.loadClass(className);
- if (LoggerContextFactory.class.isAssignableFrom(clazz)) {
- factories.add((LoggerContextFactory) clazz.newInstance());
- } else {
- logger.error(className + " does not implement " + LoggerContextFactory.class.getName());
- }
- } catch (ClassNotFoundException cnfe) {
- logger.error("Unable to locate class " + className + " specified in " + url.toString(), cnfe);
- } catch (IllegalAccessException iae) {
- logger.error("Unable to create class " + className + " specified in " + url.toString(), iae);
- } catch (Exception e) {
- logger.error("Unable to create class " + className + " specified in " + url.toString(), e);
- e.printStackTrace();
- }
- }
- }
- if (factories.size() != 1) {
- logger.fatal("Unable to locate a logging implementation");
- } else {
- factory = factories.get(0);
- }
- } else {
- logger.fatal("Unable to locate a logging implementation");
- }
- }
-
- /**
- * Return the LoggerContextFactory.
- * @return The LoggerContextFactory.
- */
- public static LoggerContextFactory getFactory() {
- return factory;
- }
-
- /**
- * Return a Logger with the specified name.
- *
- * @param name The logger name.
- * @return The Logger.
- */
- public static Logger getLogger(String name) {
-
- return factory.getContext(LogManager.class.getName(), false).getLogger(name);
- }
-
- /**
- * Return a Logger with the specified name.
- *
- * @param fqcn The fully qualified class name of the class that this method is a member of.
- * @param name The logger name.
- * @return The Logger.
- */
- protected static Logger getLogger(String fqcn, String name) {
-
- return factory.getContext(fqcn, false).getLogger(name);
- }
-
- /**
- * Returns the current LoggerContext.
- * <p>
- * WARNING - The LoggerContext returned by this method may not be the LoggerContext used to create a Logger
- * for the calling class.
- * @return The current LoggerContext.
- */
- public static LoggerContext getContext() {
- return factory.getContext(LogManager.class.getName(), true);
- }
-
- /**
- * Returns a LoggerContext.
- *
- * @param currentContext if false the LoggerContext appropriate for the caller of this method is returned. For
- * example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext may be
- * returned and if the caller is a class in the container's classpath then a different LoggerContext may be
- * returned. If true then only a single LoggerContext will be returned.
- * @return a LoggerContext.
- */
- public static LoggerContext getContext(boolean currentContext) {
- return factory.getContext(LogManager.class.getName(), currentContext);
- }
-
- /**
- * Returns a LoggerContext
- * @param fqcn The fully qualified class name of the Class that this method is a member of.
- * @param currentContext if false the LoggerContext appropriate for the caller of this method is returned. For
- * example, in a web application if the caller is a class in WEB-INF/lib then one LoggerContext may be
- * returned and if the caller is a class in the container's classpath then a different LoggerContext may be
- * returned. If true then only a single LoggerContext will be returned.
- * @return a LoggerContext.
- */
- protected static LoggerContext getContext(String fqcn, boolean currentContext) {
- return factory.getContext(fqcn, currentContext);
- }
-
- private static ClassLoader findClassLoader() {
- ClassLoader cl;
- if (System.getSecurityManager() == null) {
- cl = Thread.currentThread().getContextClassLoader();
- } else {
- cl = (ClassLoader) java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction() {
- public Object run() {
- return Thread.currentThread().getContextClassLoader();
- }
- }
- );
- }
- if (cl == null) {
- cl = LogManager.class.getClassLoader();
- }
-
- return cl;
- }
-
- private static boolean validVersion(String version) {
- for (String v : COMPATIBLE_API_VERSIONS) {
- if (version.startsWith(v)) {
- return true;
- }
- }
- return false;
- }
-
-
-
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Logger.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Logger.java
deleted file mode 100644
index c7ae395..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Logger.java
+++ /dev/null
@@ -1,944 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.message.Message;
-
-/**
- * This is the central interface in the log4j package. Most logging
- * operations, except configuration, are done through this interface.
- * @doubt See LOG4J2-39.
- * @doubt See LOG4J2-16.
- */
-public interface Logger {
-
- /**
- * Log entry to a method.
- */
- void entry();
-
- /**
- * Log entry to a method.
- * @param params The parameters to the method.
- * @doubt Use of varargs results in array creation which can be a substantial portion of no-op case.
- * LogMF/LogSF provides several overrides to avoid vararg except in edge cases. (RG) LogMF
- * and LogSF implement these in LogXF which calls logger.callAppenders. callAppenders is
- * part of the implementation and cannot be used by the API. Adding more methods here
- * and in AbstractLogger is sufficient.
- */
- void entry(Object... params);
-
- /**
- * Log exit from a method.
- */
- void exit();
-
- /**
- * Log exiting from a method with the result. This may be coded as <br />
- * return logger.exit(myResult);
- * @param result The result being returned from the method call.
- * @return the result.
- */
- <R> R exit(R result);
-
- /**
- * Log an exception or error to be thrown. This may be coded as <br />
- * throw logger.throwing(myException);
- *
- * @param t The Throwable.
- * @return the Throwable.
- */
- <T extends Throwable> T throwing(T t);
-
- /**
- * Log an exception or error to be thrown. This may be coded as <br />
- * throw logger.throwing(debug, myException);
- * @param level The logging Level.
- * @param t The Throwable.
- * @return the Throwable.
- */
- <T extends Throwable> T throwing(Level level, T t);
-
- /**
- * Log an exception or error that has been caught.
- * @param t The Throwable.
- */
- void catching(Throwable t);
-
- /**
- * Log an exception or error that has been caught.
- * @param level The logging Level.
- * @param t The Throwable.
- */
- void catching(Level level, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param message the message object to log.
- */
- void trace(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void trace(Marker marker, String message);
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void trace(String message, Throwable t);
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void trace(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param message the message object to log.
- */
- void trace(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void trace(Marker marker, Object message);
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void trace(Object message, Throwable t);
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void trace(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>TRACE</code> level.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- void trace(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>TRACE</code> level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message to log.
- * @param params parameters to the message.
- */
- void trace(Marker marker, String message, Object... params);
-
- /**
- * Check whether this Logger is enabled for the TRACE Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * TRACE, <code>false</code> otherwise.
- */
- boolean isTraceEnabled();
-
- /**
- * Check whether this Logger is enabled for the TRACE Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * TRACE, <code>false</code> otherwise.
- */
- boolean isTraceEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- */
- void trace(Message msg);
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void trace(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void trace(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void trace(Marker marker, Message msg, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param message the message object to log.
- */
- void debug(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void debug(Marker marker, String message);
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- void debug(String message, Throwable t);
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- void debug(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param message the message object to log.
- */
- void debug(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void debug(Marker marker, Object message);
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- void debug(Object message, Throwable t);
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- void debug(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>DEBUG</code> level.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- void debug(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>DEBUG</code> level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message to log.
- * @param params parameters to the message.
- */
- void debug(Marker marker, String message, Object... params);
-
- /**
- * Check whether this Logger is enabled for the DEBUG Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * DEBUG, <code>false</code> otherwise.
- */
- boolean isDebugEnabled();
-
- /**
- * Check whether this Logger is enabled for the DEBUG Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * DEBUG, <code>false</code> otherwise.
- */
- boolean isDebugEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param msg the message string to be logged
- */
- void debug(Message msg);
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void debug(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void debug(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void debug(Marker marker, Message msg, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param message the message object to log.
- */
- void info(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void info(Marker marker, String message);
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void info(String message, Throwable t);
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void info(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param message the message object to log.
- */
- void info(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void info(Marker marker, Object message);
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void info(Object message, Throwable t);
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void info(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>INFO</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) It isn't
- * possible to be misinterpreted as the previous method is for that signature. Methods
- * should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void info(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>INFO</code> level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) It isn't
- * possible to be misinterpreted as the previous method is for that signature. Methods
- * should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void info(Marker marker, String message, Object... params);
- /**
- * Check whether this Logger is enabled for the INFO Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * INFO, <code>false</code> otherwise.
- */
- boolean isInfoEnabled();
-
- /**
- * Check whether this Logger is enabled for the INFO Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * INFO, <code>false</code> otherwise.
- */
- boolean isInfoEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- */
- void info(Message msg);
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void info(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void info(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void info(Marker marker, Message msg, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param message the message object to log.
- */
- void warn(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void warn(Marker marker, String message);
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void warn(String message, Throwable t);
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void warn(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param message the message object to log.
- */
- void warn(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- */
- void warn(Marker marker, Object message);
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void warn(Object message, Throwable t);
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void warn(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>WARN</code> level.
- * @param message the message to log.
- * @param params parameters to the message.
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you
- * meant warn, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature.Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void warn(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>WARN</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you
- * meant warn, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature.Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void warn(Marker marker, String message, Object... params);
-
- /**
- * Check whether this Logger is enabled for the WARN Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * WARN, <code>false</code> otherwise.
- */
- boolean isWarnEnabled();
-
- /**
- * Check whether this Logger is enabled for the WARN Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * WARN, <code>false</code> otherwise.
- */
- boolean isWarnEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param msg the message string to be logged
- */
- void warn(Message msg);
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void warn(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void warn(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void warn(Marker marker, Message msg, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param message the message object to log.
- */
- void error(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- void error(Marker marker, String message);
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void error(String message, Throwable t);
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void error(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param message the message object to log.
- */
- void error(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- void error(Marker marker, Object message);
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void error(Object message, Throwable t);
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void error(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>ERROR</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you
- * meant error, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void error(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>ERROR</code> level.
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call. (RG) I assume you
- * meant error, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void error(Marker marker, String message, Object... params);
-
- /**
- * Check whether this Logger is enabled for the ERROR Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * ERROR, <code>false</code> otherwise.
- */
- boolean isErrorEnabled();
-
- /**
- * Check whether this Logger is enabled for the ERROR Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * ERROR, <code>false</code> otherwise.
- */
- boolean isErrorEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param msg the message string to be logged
- */
- void error(Message msg);
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void error(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void error(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void error(Marker marker, Message msg, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param message the message object to log.
- */
- void fatal(String message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param marker The marker data specific to this log statement.
- * @param message the message object to log.
- */
- void fatal(Marker marker, String message);
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void fatal(String message, Throwable t);
-
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker The marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void fatal(Marker marker, String message, Throwable t);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param message the message object to log.
- */
- void fatal(Object message);
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param marker The marker data specific to this log statement.
- * @param message the message object to log.
- */
- void fatal(Marker marker, Object message);
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void fatal(Object message, Throwable t);
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker The marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- void fatal(Marker marker, Object message, Throwable t);
-
- /**
- * Log a message with parameters at the <code>FATAL</code> level.
- *
- *
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call.(RG) I assume you
- * meant fatal, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void fatal(String message, Object... params);
-
- /**
- * Log a message with parameters at the <code>FATAL</code> level.
- *
- * @param marker The marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- *
- * @doubt Likely to misinterpret existing log4j client code that intended to call
- * info(Object,Throwable). Incurs array creation expense on every call.(RG) I assume you
- * meant fatal, not info. It isn't possible to be misinterpreted as the previous method
- * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
- */
- void fatal(Marker marker, String message, Object... params);
-
- /**
- * Check whether this Logger is enabled for the FATAL Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * FATAL, <code>false</code> otherwise.
- */
- boolean isFatalEnabled();
-
- /**
- * Check whether this Logger is enabled for the FATAL Level.
- *
- * @param marker The marker data specific to this log statement.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * FATAL, <code>false</code> otherwise.
- */
- boolean isFatalEnabled(Marker marker);
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param msg the message string to be logged
- */
- void fatal(Message msg);
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void fatal(Message msg, Throwable t);
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- void fatal(Marker marker, Message msg);
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- void fatal(Marker marker, Message msg, Throwable t);
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LoggingException.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LoggingException.java
deleted file mode 100644
index 49969c2..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/LoggingException.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-/**
- * Exception thrown when a exception occurs while logging. In most cases exceptions will be handled
- * within Log4j but certain Appenders may be configured to allow exceptions to propagate to the
- * application. This is a RuntimeException so that the exception may be thrown in those cases without
- * requiring all Logger methods be contained with try/catch blocks.
- *
- */
-public class LoggingException extends RuntimeException {
-
- private static final long serialVersionUID = 6366395965071580537L;
-
- /**
- * Constructs a LoggingException with a message.
- * @param msg The message.
- */
- public LoggingException(String msg) {
- super(msg);
- }
-
- /**
- * Constructs a LoggingException with a message and a chained Exception.
- * @param msg The message.
- * @param ex The chained Exception.
- */
- public LoggingException(String msg, Exception ex) {
- super(msg, ex);
- }
-
- /**
- * Constructs a Logging Exception with a chained Exception and no message.
- * @param ex The chained Exception.
- */
- public LoggingException(Exception ex) {
- super(ex);
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Marker.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Marker.java
deleted file mode 100644
index 37cb3ed..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/Marker.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import java.io.Serializable;
-
-/**
- * Markers are objects that are used to add easily filterable information to log messages.
- *
- * Markers can be hierarchical - each Marker may have a parent. This allows for broad categories
- * being subdivided into more specific categories. An example might be a Marker named "Error" with
- * children named "SystemError" and "ApplicationError".
- */
-public interface Marker extends Serializable {
-
- /**
- * Returns the name of this Marker.
- * @return The name of the Marker.
- */
- String getName();
-
- /**
- * Returns the parent of this Marker.
- * @return The parent Marker or null if this Marker has no parent.
- */
- Marker getParent();
-
- /**
- * Checks whether this Marker is an instance of the specified Marker.
- * @param m The Marker to check.
- * @return true of this Marker or one of its ancestors is the specified Marker, false otherwise.
- */
- boolean isInstanceOf(Marker m);
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
deleted file mode 100644
index 4bbd660..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-
-/**
- * Applications create Markers by using the Marker Manager. All Markers created by this Manager are
- * immutable.
- */
-public final class MarkerManager {
-
- private static ConcurrentMap<String, Marker> markerMap = new ConcurrentHashMap<String, Marker>();
-
- private MarkerManager() {
- }
-
- /**
- * Retrieve a Marker or create a Marker that has no parent.
- * @param name The name of the Marker.
- * @return The Marker with the specified name.
- */
- public static Marker getMarker(String name) {
- markerMap.putIfAbsent(name, new Log4JMarker(name));
- return markerMap.get(name);
- }
-
- /**
- * Retrieves or creates a Marker with the specified parent. The parent must have been previously created.
- * @param name The name of the Marker.
- * @param parent The name of the parent Marker.
- * @return The Marker with the specified name.
- * @throws IllegalArgumentException if the parent Marker does not exist.
- */
- public static Marker getMarker(String name, String parent) {
- Marker parentMarker = markerMap.get(parent);
- if (parentMarker == null) {
- throw new IllegalArgumentException("Parent Marker " + parent + " has not been defined");
- }
- return getMarker(name, parentMarker);
- }
-
- /**
- * Retrieves or creates a Marker with the specified parent.
- * @param name The name of the Marker.
- * @param parent The parent Marker.
- * @return The Marker with the specified name.
- */
- public static Marker getMarker(String name, Marker parent) {
- markerMap.putIfAbsent(name, new Log4JMarker(name, parent));
- return markerMap.get(name);
- }
-
- /**
- * The actual Marker implementation.
- */
- private static class Log4JMarker implements Marker {
-
- private static final long serialVersionUID = 100L;
-
- private final String name;
- private final Marker parent;
-
- public Log4JMarker(String name) {
- this.name = name;
- this.parent = null;
- }
-
- public Log4JMarker(String name, Marker parent) {
- this.name = name;
- this.parent = parent;
- }
-
- public String getName() {
- return this.name;
- }
-
- public Marker getParent() {
- return this.parent;
- }
-
- public boolean isInstanceOf(Marker m) {
- if (m == null) {
- throw new IllegalArgumentException("A marker parameter is required");
- }
- Marker test = this;
- do {
- if (test == m) {
- return true;
- }
- test = test.getParent();
- } while (test != null);
- return false;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- Marker marker = (Marker) o;
-
- if (name != null ? !name.equals(marker.getName()) : marker.getName() != null) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return name != null ? name.hashCode() : 0;
- }
-
- public String toString() {
- StringBuilder sb = new StringBuilder(name);
- if (parent != null) {
- Marker m = parent;
- sb.append("[ ");
- boolean first = true;
- while (m != null) {
- if (!first) {
- sb.append(", ");
- }
- sb.append(m.getName());
- first = false;
- m = m.getParent();
- }
- sb.append(" ]");
- }
- return sb.toString();
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/ThreadContext.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
deleted file mode 100644
index add7efe..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/ThreadContext.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-
-
-/**
- * The ThreadContext allows applications to store information either in a Map
- * <p/>
- * <p><b><em>The MDC is managed on a per thread basis</em></b>. A
- * child thread automatically inherits a <em>copy</em> of the mapped
- * diagnostic context of its parent.
- */
-public final class ThreadContext {
-
- private static ThreadLocal<Map<String, String>> localMap =
- new InheritableThreadLocal<Map<String, String>>() {
- protected Map<String, String> childValue(Map<String, String> parentValue) {
- return parentValue == null ? null : new HashMap<String, String>(parentValue);
- }
- };
-
- private static ThreadLocal<Stack<String>> localStack =
- new InheritableThreadLocal<Stack<String>>() {
- protected Stack<String> childValue(Stack<String> parentValue) {
- return parentValue == null ? null : (Stack<String>) parentValue.clone();
- }
- };
-
-
-
- private ThreadContext() {
-
- }
-
- /**
- * Put a context value (the <code>o</code> parameter) as identified
- * with the <code>key</code> parameter into the current thread's
- * context map.
- * <p/>
- * <p>If the current thread does not have a context map it is
- * created as a side effect.
- * @param key The key name.
- * @param value The key value.
- */
- public static void put(String key, String value) {
- Map<String, String> map = localMap.get();
- if (map == null) {
- map = new HashMap<String, String>();
- localMap.set(map);
- }
- map.put(key, value);
- }
-
- /**
- * Get the context identified by the <code>key</code> parameter.
- * <p/>
- * <p>This method has no side effects.
- * @param key The key to locate.
- * @return The value associated with the key or null.
- */
- public static String get(String key) {
- Map<String, String> map = localMap.get();
- return map == null ? null : map.get(key);
- }
-
- /**
- * Remove the the context identified by the <code>key</code>
- * parameter.
- * @param key The key to remove.
- */
- public static void remove(String key) {
- Map<String, String> map = localMap.get();
- if (map != null) {
- map.remove(key);
- }
- }
-
- /**
- * Clear the context.
- */
- public static void clear() {
- localMap.remove();
- }
-
- /**
- * Determine if the key is in the context.
- * @param key The key to locate.
- * @return True if the key is in the context, false otherwise.
- */
- public static boolean containsKey(String key) {
- Map<String, String> map = localMap.get();
- return map == null ? false : map.containsKey(key);
- }
-
- /**
- * Get the current thread's MDC as a hashtable. This method is
- * intended to be used internally.
- * @return a copy of the context.
- */
- public static Map<String, String> getContext() {
- Map<String, String> map = localMap.get();
- return map == null ? new HashMap<String, String>() : new HashMap<String, String>(localMap.get());
- }
-
- /**
- * Clear the stack for this thread.
- */
- public static void clearStack() {
- localStack.remove();
- }
-
- /**
- * Return a copy of this thread's stack.
- * @return A copy of this thread's stack.
- */
- public static Stack<String> cloneStack() {
- Stack<String> stack = localStack.get();
- return stack == null ? new Stack<String>() : (Stack<String>) stack.clone();
- }
-
- /**
- * Set this thread's stack.
- * @param stack The stack to use.
- */
- public static void setStack(Stack<String> stack) {
- localStack.set(stack);
- }
-
- /**
- * Get the current nesting depth of this thread's stack.
- * @return the number of items in the stack.
- *
- * @see #setMaxDepth
- */
- public static int getDepth() {
- Stack<String> stack = localStack.get();
- return stack == null ? 0 : stack.size();
- }
-
- /**
- * Returns the value of the last item placed on the stack.
- * <p/>
- * <p>The returned value is the value that was pushed last. If no
- * context is available, then the empty string "" is returned.
- *
- * @return String The innermost diagnostic context.
- */
- public static String pop() {
- Stack<String> s = localStack.get();
- if (s == null || s.isEmpty()) {
- return "";
- }
- return s.pop();
- }
-
- /**
- * Looks at the last diagnostic context at the top of this NDC
- * without removing it.
- * <p/>
- * <p>The returned value is the value that was pushed last. If no
- * context is available, then the empty string "" is returned.
- *
- * @return String The innermost diagnostic context.
- */
- public static String peek() {
- Stack<String> s = localStack.get();
- if (s == null || s.isEmpty()) {
- return "";
- }
- return s.peek();
- }
-
- /**
- * Push new diagnostic context information for the current thread.
- * <p/>
- * <p>The contents of the <code>message</code> parameter is
- * determined solely by the client.
- *
- * @param message The new diagnostic context information.
- */
- public static void push(String message) {
- Stack<String> stack = localStack.get();
- if (stack == null) {
- stack = new Stack<String>();
- }
- stack.push(message);
- }
-
- /**
- * Remove the diagnostic context for this thread.
- * <p/>
- * <p>Each thread that created a diagnostic context by calling
- * {@link #push} should call this method before exiting. Otherwise,
- * the memory used by the <b>thread</b> cannot be reclaimed by the
- * VM.
- * <p/>
- * <p>As this is such an important problem in heavy duty systems and
- * because it is difficult to always guarantee that the remove
- * method is called before exiting a thread, this method has been
- * augmented to lazily remove references to dead threads. In
- * practice, this means that you can be a little sloppy and
- * occasionally forget to call {@link #remove} before exiting a
- * thread. However, you must call <code>remove</code> sometime. If
- * you never call it, then your application is sure to run out of
- * memory.
- */
- public static void removeStack() {
- localStack.remove();
- }
-
- /**
- * Set maximum depth of this diagnostic context. If the current
- * depth is smaller or equal to <code>maxDepth</code>, then no
- * action is taken.
- * <p/>
- * <p>This method is a convenient alternative to multiple {@link
- * #pop} calls. Moreover, it is often the case that at the end of
- * complex call sequences, the depth of the NDC is
- * unpredictable. The <code>setMaxDepth</code> method circumvents
- * this problem.
- * <p/>
- * <p>For example, the combination
- * <pre>
- * void foo() {
- * int depth = NDC.getDepth();
- * <p/>
- * ... complex sequence of calls
- * <p/>
- * NDC.setMaxDepth(depth);
- * }
- * </pre>
- * <p/>
- * ensures that between the entry and exit of foo the depth of the
- * diagnostic stack is conserved.
- *
- * @see #getDepth
- * @param maxDepth The maximum depth of the stack.
- */
- public static void setMaxDepth(int maxDepth) {
-
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java
deleted file mode 100644
index a31d941..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/BasicThreadInformation.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Generates information about the current Thread. Used internally by ThreadDumpMessage.
- */
-class BasicThreadInformation implements ThreadInformation {
- private static final int HASH_SHIFT = 32;
- private static final int HASH_MULTIPLIER = 31;
- private final long id;
- private final String name;
- private final String longName;
- private final Thread.State state;
- private final int priority;
- private final boolean isAlive;
- private final boolean isDaemon;
- private final String threadGroupName;
-
- /**
- * The Constructor.
- * @param thread The Thread to capture.
- */
- public BasicThreadInformation(Thread thread) {
- this.id = thread.getId();
- this.name = thread.getName();
- this.longName = thread.toString();
- this.state = thread.getState();
- this.priority = thread.getPriority();
- this.isAlive = thread.isAlive();
- this.isDaemon = thread.isDaemon();
- ThreadGroup group = thread.getThreadGroup();
- threadGroupName = group == null ? null : group.getName();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- BasicThreadInformation that = (BasicThreadInformation) o;
-
- if (id != that.id) {
- return false;
- }
- if (name != null ? !name.equals(that.name) : that.name != null) {
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = (int) (id ^ (id >>> HASH_SHIFT));
- result = HASH_MULTIPLIER * result + (name != null ? name.hashCode() : 0);
- return result;
- }
-
- /**
- * Print the thread information.
- * @param sb The StringBuilder.
- */
- public void printThreadInfo(StringBuilder sb) {
- sb.append("\"").append(name).append("\" ");
- if (isDaemon) {
- sb.append("daemon ");
- }
- sb.append("prio=").append(priority).append(" tid=").append(id).append(" ");
- if (threadGroupName != null) {
- sb.append("group=\"").append(threadGroupName).append("\"");
- }
- sb.append("\n");
- sb.append("\tThread state: ").append(state.name()).append("\n");
- }
-
- /**
- * Format the StackTraceElements.
- * @param sb The StringBuilder.
- * @param trace The stack trace element array to format.
- */
- public void printStack(StringBuilder sb, StackTraceElement[] trace) {
- for (StackTraceElement element : trace) {
- sb.append("\tat ").append(element).append("\n");
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ExtendedThreadInformation.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ExtendedThreadInformation.java
deleted file mode 100644
index 6e0d873..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ExtendedThreadInformation.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.lang.management.LockInfo;
-import java.lang.management.MonitorInfo;
-import java.lang.management.ThreadInfo;
-
-/**
- * Provides information on locks and monitors in the thread dump. This class requires Java 1.6 to compile and
- * run.
- */
-class ExtendedThreadInformation implements ThreadInformation {
-
- private final ThreadInfo info;
-
-
- public ExtendedThreadInformation(ThreadInfo thread) {
- this.info = thread;
- }
-
- public void printThreadInfo(StringBuilder sb) {
- sb.append("\"").append(info.getThreadName()).append("\"");
- sb.append(" Id=").append(info.getThreadId()).append(" ");
- formatState(sb, info);
- if (info.isSuspended()) {
- sb.append(" (suspended)");
- }
- if (info.isInNative()) {
- sb.append(" (in native)");
- }
- sb.append('\n');
- }
-
- public void printStack(StringBuilder sb, StackTraceElement[] stack) {
- int i = 0;
- for (StackTraceElement element : stack) {
- sb.append("\tat ").append(element.toString());
- sb.append('\n');
- if (i == 0 && info.getLockInfo() != null) {
- Thread.State ts = info.getThreadState();
- switch (ts) {
- case BLOCKED:
- sb.append("\t- blocked on ");
- formatLock(sb, info.getLockInfo());
- sb.append('\n');
- break;
- case WAITING:
- sb.append("\t- waiting on ");
- formatLock(sb, info.getLockInfo());
- sb.append('\n');
- break;
- case TIMED_WAITING:
- sb.append("\t- waiting on ");
- formatLock(sb, info.getLockInfo());
- sb.append('\n');
- break;
- default:
- }
- }
-
- for (MonitorInfo mi : info.getLockedMonitors()) {
- if (mi.getLockedStackDepth() == i) {
- sb.append("\t- locked ");
- formatLock(sb, mi);
- sb.append('\n');
- }
- }
- ++i;
- }
-
- LockInfo[] locks = info.getLockedSynchronizers();
- if (locks.length > 0) {
- sb.append("\n\tNumber of locked synchronizers = ").append(locks.length).append('\n');
- for (LockInfo li : locks) {
- sb.append("\t- ");
- formatLock(sb, li);
- sb.append('\n');
- }
- }
- }
-
- private void formatLock(StringBuilder sb, LockInfo lock) {
- sb.append("<").append(lock.getIdentityHashCode()).append("> (a ");
- sb.append(lock.getClassName()).append(")");
- }
-
- private void formatState(StringBuilder sb, ThreadInfo info) {
- Thread.State state = info.getThreadState();
- sb.append(state);
- switch (state) {
- case BLOCKED: {
- sb.append(" (on object monitor owned by \"");
- sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId()).append(")");
- break;
- }
- case WAITING: {
- StackTraceElement element = info.getStackTrace()[0];
- String className = element.getClassName();
- String method = element.getMethodName();
- if (className.equals("java.lang.Object") && method.equals("wait")) {
- sb.append(" (on object monitor");
- if (info.getLockOwnerName() != null) {
- sb.append(" owned by \"");
- sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
- }
- sb.append(")");
- } else if (className.equals("java.lang.Thread") && method.equals("join")) {
- sb.append(" (on completion of thread ").append(info.getLockOwnerId()).append(")");
- } else {
- sb.append(" (parking for lock");
- if (info.getLockOwnerName() != null) {
- sb.append(" owned by \"");
- sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
- }
- sb.append(")");
- }
- break;
- }
- case TIMED_WAITING: {
- StackTraceElement element = info.getStackTrace()[0];
- String className = element.getClassName();
- String method = element.getMethodName();
- if (className.equals("java.lang.Object") && method.equals("wait")) {
- sb.append(" (on object monitor");
- if (info.getLockOwnerName() != null) {
- sb.append(" owned by \"");
- sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
- }
- sb.append(")");
- } else if (className.equals("java.lang.Thread") && method.equals("sleep")) {
- sb.append(" (sleeping)");
- } else if (className.equals("java.lang.Thread") && method.equals("join")) {
- sb.append(" (on completion of thread ").append(info.getLockOwnerId()).append(")");
- } else {
- sb.append(" (parking for lock");
- if (info.getLockOwnerName() != null) {
- sb.append(" owned by \"");
- sb.append(info.getLockOwnerName()).append("\" Id=").append(info.getLockOwnerId());
- }
- sb.append(")");
- }
- break;
- }
- default:
- break;
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
deleted file mode 100644
index 8a4cf97..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/FormattedMessage.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * A Message that can have a format String attached to it.
- */
-public interface FormattedMessage extends Message {
- /**
- * Set the message format.
- * @param format The message format.
- */
- void setFormat(String format);
-
- /**
- * Return the message format.
- * @return the message format String.
- */
- String getFormat();
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
deleted file mode 100644
index 0141c60..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LocalizedMessage.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.apache.logging.log4j.status.StatusLogger;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * This class is not the recommended way to Localize messages. It is provided to provide some level
- * of compatibility with Log4j 1.x.
- *
- * The recommended way to localize messages is to simply log a message id. Log events should
- * then be recorded without formatting into some kind of data store. The application that is
- * used to read the events and display them to the user should also localize and format the
- * messages for the end user.
- */
-public class LocalizedMessage extends ParameterizedMessage implements LoggerNameAwareMessage
-{
- private static final long serialVersionUID = 3893703791567290742L;
-
- private String bundleId;
-
- private transient ResourceBundle bundle;
-
- private Locale locale;
-
- private transient StatusLogger logger = StatusLogger.getLogger();
-
- private String loggerName = null;
-
- /**
- * The basic constructor.
- */
- public LocalizedMessage() {
- super();
- setup(null, null, null);
- }
-
- public LocalizedMessage(String messagePattern, String[] stringArgs, Throwable throwable) {
- super(messagePattern, stringArgs, throwable);
- setup(null, null, null);
- }
-
-
- public LocalizedMessage(String bundleId, String key, String[] stringArgs,
- Throwable throwable) {
- super(key, stringArgs, throwable);
- setup(bundleId, null, null);
- }
-
- public LocalizedMessage(ResourceBundle bundle, String key, String[] stringArgs,
- Throwable throwable) {
- super(key, stringArgs, throwable);
- setup(null, bundle, null);
- }
-
- public LocalizedMessage(String bundleId, Locale locale, String key, String[] stringArgs,
- Throwable throwable) {
- super(key, stringArgs, throwable);
- setup(bundleId, null, locale);
- }
-
- public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, String[] stringArgs,
- Throwable throwable) {
- super(key, stringArgs, throwable);
- setup(null, bundle, locale);
- }
-
- public LocalizedMessage(Locale locale, String key, String[] stringArgs, Throwable throwable) {
- super(key, stringArgs, throwable);
- setup(null, null, locale);
- }
-
-
- /**
- * <p>This method returns a LocalizedMessage which contains the arguments converted to String
- * as well as an optional Throwable.</p>
- * <p/>
- * <p>If the last argument is a Throwable and is NOT used up by a placeholder in the message
- * pattern it is returned in LocalizedMessage.getThrowable() and won't be contained in the
- * created String[].<br/>
- * If it is used up ParameterizedMessage.getThrowable() will return null even if the last
- * argument was a Throwable!</p>
- *
- * @param messagePattern the message pattern that to be checked for placeholders.
- * @param arguments the argument array to be converted.
- */
- public LocalizedMessage(String messagePattern, Object[] arguments) {
- super(messagePattern, arguments);
- setup(null, null, null);
- }
-
- public LocalizedMessage(String bundleId, String key, Object[] arguments) {
- super(key, arguments);
- setup(bundleId, null, null);
- }
-
- public LocalizedMessage(ResourceBundle bundle, String key, Object[] arguments) {
- super(key, arguments);
- setup(null, bundle, null);
- }
-
- public LocalizedMessage(String bundleId, Locale locale, String key, Object[] arguments) {
- super(key, arguments);
- setup(bundleId, null, locale);
- }
-
- public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object[] arguments) {
- super(key, arguments);
- setup(null, bundle, locale);
- }
-
- public LocalizedMessage(Locale locale, String key, Object[] arguments) {
- super(key, arguments);
- setup(null, null, locale);
- }
-
- public LocalizedMessage(String messagePattern, Object arg) {
- super(messagePattern, arg);
- setup(null, null, null);
- }
-
- public LocalizedMessage(String bundleId, String key, Object arg) {
- super(key, arg);
- setup(bundleId, null, null);
- }
-
- public LocalizedMessage(ResourceBundle bundle, String key, Object arg) {
- super(key, arg);
- setup(null, bundle, null);
- }
-
- public LocalizedMessage(String bundleId, Locale locale, String key, Object arg) {
- super(key, arg);
- setup(bundleId, null, locale);
- }
-
- public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object arg) {
- super(key, arg);
- setup(null, bundle, locale);
- }
-
- public LocalizedMessage(Locale locale, String key, Object arg) {
- super(key, arg);
- setup(null, null, locale);
- }
-
- public LocalizedMessage(String messagePattern, Object arg1, Object arg2) {
- super(messagePattern, arg1, arg2);
- setup(null, null, null);
- }
-
- public LocalizedMessage(String bundleId, String key, Object arg1, Object arg2) {
- super(key, arg1, arg2);
- setup(bundleId, null, null);
- }
-
- public LocalizedMessage(ResourceBundle bundle, String key, Object arg1, Object arg2) {
- super(key, arg1, arg2);
- setup(null, bundle, null);
- }
-
- public LocalizedMessage(String bundleId, Locale locale, String key, Object arg1, Object arg2) {
- super(key, arg1, arg2);
- setup(bundleId, null, locale);
- }
-
- public LocalizedMessage(ResourceBundle bundle, Locale locale, String key, Object arg1,
- Object arg2) {
- super(key, arg1, arg2);
- setup(null, bundle, locale);
- }
-
- public LocalizedMessage(Locale locale, String key, Object arg1, Object arg2) {
- super(key, arg1, arg2);
- setup(null, null, locale);
- }
-
- /**
- * Set the name of the Logger.
- * @param name The name of the Logger.
- */
- public void setLoggerName(String name) {
- this.loggerName = name;
- }
-
- /**
- * Return the name of the Logger.
- * @return the name of the Logger.
- */
- public String getLoggerName() {
- return this.loggerName;
- }
-
- private void setup(String bundleId, ResourceBundle bundle, Locale locale) {
- this.bundleId = bundleId;
- this.bundle = bundle;
- this.locale = locale;
- }
-
- /**
- * Return the formatted message after looking up the format in the resource bundle.
- * @param messagePattern The key for the resource bundle or the pattern if the bundle doesn't contain the key.
- * @param args The parameters.
- * @return The formatted message String.
- */
- @Override
- public String formatMessage(String messagePattern, String[] args) {
- ResourceBundle bundle = this.bundle;
- if (bundle == null) {
- if (bundleId != null) {
- bundle = getBundle(bundleId, locale, false);
- } else {
- bundle = getBundle(loggerName, locale, true);
- }
- }
- String msgPattern = (bundle == null || !bundle.containsKey(messagePattern)) ?
- messagePattern : bundle.getString(messagePattern);
- return format(msgPattern, args);
- }
-
- /**
- * Override this to use a ResourceBundle.Control in Java 6
- * @param key The key to the bundle.
- * @param locale The locale to use when formatting the message.
- * @param loop If true the key will be treated as a package or class name and a resource bundle will
- * be located based on all or part of the package name. If false the key is expected to be the exact bundle id.
- * @return The ResourceBundle.
- */
- protected ResourceBundle getBundle(String key, Locale locale, boolean loop) {
- ResourceBundle rb = null;
-
- if (key == null) {
- return null;
- }
- try {
- if (locale != null) {
- rb = ResourceBundle.getBundle(key, locale);
- } else {
- rb = ResourceBundle.getBundle(key);
- }
- } catch (MissingResourceException ex) {
- if (!loop) {
- logger.debug("Unable to locate ResourceBundle " + key);
- return null;
- }
- }
-
- String substr = key;
- int i;
- while (rb == null && (i = substr.lastIndexOf(".")) > 0) {
- substr = substr.substring(0, i);
- try {
- if (locale != null) {
- rb = ResourceBundle.getBundle(substr, locale);
- } else {
- rb = ResourceBundle.getBundle(substr);
- }
- } catch (MissingResourceException ex) {
- logger.debug("Unable to locate ResourceBundle " + substr);
- }
- }
- return rb;
- }
-
- private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
- stream.defaultReadObject();
- bundle = null;
- logger = StatusLogger.getLogger();
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LoggerNameAwareMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LoggerNameAwareMessage.java
deleted file mode 100644
index a4821a4..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/LoggerNameAwareMessage.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Message that is interested in the name of the Logger.
- */
-public interface LoggerNameAwareMessage {
- /**
- * The name of the Logger.
- * @param name The name of the Logger.
- */
- void setLoggerName(String name);
-
- /**
- * Returns the name of the Logger.
- * @return The name of the Logger.
- */
- String getLoggerName();
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
deleted file mode 100644
index baa1b66..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayOutputStream;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-/**
- * Represents a Message that consists of a Map.
- */
-public class MapMessage implements FormattedMessage, Serializable {
- /**
- * When set as the format specifier causes the Map to be formatted as XML.
- */
- public static final String XML = "XML";
- private static final long serialVersionUID = -5031471831131487120L;
-
- private final Map<String, String> data;
-
- private String format = null;
-
- /**
- * Constructor.
- */
- public MapMessage() {
- data = new HashMap<String, String>();
- }
-
- /**
- * Constructor based on an existing Map.
- * @param map The Map.
- */
- public MapMessage(Map<String, String> map) {
- this.data = map;
- }
-
- /**
- * The format String. Specifying "xml" will cause the message to be XML.
- * @param format The message format.
- */
- public void setFormat(String format) {
- this.format = format;
- }
-
- /**
- * Return the format String.
- * @return the format String.
- */
- public String getFormat() {
- return this.format;
- }
-
-
- /**
- * Return the data elements as if they were parameters on the logging event.
- * @return the data elements.
- */
- public Object[] getParameters() {
- return data.values().toArray();
- }
-
- /**
- * Return the message.
- * @return the message.
- */
- public String getMessageFormat() {
- return "";
- }
-
- /**
- * Return the message data as an unmodifiable Map.
- * @return the message data as an unmodifiable map.
- */
- public Map<String, String> getData() {
- return Collections.unmodifiableMap(data);
- }
-
- /**
- * Clear the data.
- */
- public void clear() {
- data.clear();
- }
-
- /**
- * Add an item to the data Map.
- * @param key The name of the data item.
- * @param value The value of the data item.
- */
- public void put(String key, String value) {
- if (value == null) {
- throw new IllegalArgumentException("No value provided for key " + key);
- }
- validate(key, value);
- data.put(key, value);
- }
-
- protected void validate(String key, String value) {
-
- }
-
- /**
- * Add all the elements from the specified Map.
- * @param map The Map to add.
- */
- public void putAll(Map<String, String> map) {
- data.putAll(map);
- }
-
- /**
- * Retrieve the value of the element with the specified key or null if the key is not present.
- * @param key The name of the element.
- * @return The value of the element or null if the key is not present.
- */
- public String get(String key) {
- return data.get(key);
- }
-
- /**
- * Remove the element with the specified name.
- * @param key The name of the element.
- * @return The previous value of the element.
- */
- public String remove(String key) {
- return data.remove(key);
- }
-
- /**
- * Format the Structured data as described in RFC 5424.
- *
- * @return The formatted String.
- */
- public String asString() {
- return asString(format == null ? "" : format);
- }
-
- /**
- * Format the Structured data as described in RFC 5424.
- *
- * @param format The format identifier. Ignored in this implementation.
- * @return The formatted String.
- */
- public String asString(String format) {
- StringBuilder sb = new StringBuilder();
- if (format.equalsIgnoreCase(XML)) {
- asXML(sb);
- } else {
- appendMap(sb);
- }
- return sb.toString();
- }
-
- public void asXML(StringBuilder sb) {
- sb.append("<Map>\n");
- SortedMap<String, String> sorted = new TreeMap<String, String>(data);
- for (Map.Entry<String, String> entry : sorted.entrySet()) {
- sb.append(" <Entry key=").append(entry.getKey()).append(">").append(entry.getValue()).append("</Entry>\n");
- }
- sb.append("</Map>");
- }
-
- /**
- * Format the message and return it.
- * @return the formatted message.
- */
- public String getFormattedMessage() {
- return asString();
- }
-
- protected void appendMap(StringBuilder sb) {
- SortedMap<String, String> sorted = new TreeMap<String, String>(data);
- boolean first = true;
- for (Map.Entry<String, String> entry : sorted.entrySet()) {
- if (!first) {
- sb.append(" ");
- }
- first = false;
- sb.append(entry.getKey()).append("=\"").append(entry.getValue()).append("\"");
- }
- }
-
- public MapMessage newInstance(Map<String, String> map) {
- return new MapMessage(map);
- }
-
- public String toString() {
- return asString();
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- MapMessage that = (MapMessage) o;
-
- return this.data.equals(that.data);
- }
-
- public int hashCode() {
- return data.hashCode();
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/Message.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/Message.java
deleted file mode 100644
index ad66933..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/Message.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.Serializable;
-
-/**
- * An interface for various Message implementations that can be logged. Messages can act as wrappers
- * around Objects so that user can have control over converting Objects to Strings when necessary without
- * requiring complicated formatters and as a way to manipulate the message based on information available
- * at runtime such as the locale of the system.
- *
- * Note: Message objects should not be considered to be thread safe nor should they be assumed to be
- * safely reusable even on the same thread. The logging system may provide information to the Message
- * objects and the Messages might be queued for asynchronous delivery. Thus, any modifications to a
- * Message object by an application should by avoided after the Message has been passed as a parameter on
- * a Logger method.
- * @doubt Interfaces should rarely extend Serializable according to Effective Java 2nd Ed pg 291.
- * (RG) That section also says "If a class or interface exists primarily to participate in a framework that
- * requires all participants to implement Serializable, then it makes perfect sense for the class or
- * interface to implement or extend Serializable". Such is the case here as the LogEvent must be Serializable.
- */
-public interface Message extends Serializable {
- /**
- * Returns the Message formatted as a String.
- *
- * @return The message String.
- */
- String getFormattedMessage();
-
- /**
- * Returns the format portion of the Message.
- *
- * @return The message format.
- * @doubt Do all messages have a format? What syntax? Using a Formatter object could be cleaner.
- * (RG) In SimpleMessage the format is identical to the formatted message. In ParameterizedMessage and
- * StructuredDataMessage itis not. It is up to the Message implementer to determine what this
- * method will return. A Formatter is inappropriate as this is very specific to the Message
- * implementation so it isn't clear to me how having a Formatter separate from the Message would be cleaner.
- */
- String getMessageFormat();
-
- /**
- * Returns parameter values, if any.
- *
- * @return An array of parameter values or null.
- */
- Object[] getParameters();
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
deleted file mode 100644
index 6a374d0..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ObjectMessage.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-/**
- * Handles messages that contain an Object.
- */
-public class ObjectMessage implements Message, Serializable {
-
- private static final long serialVersionUID = -5903272448334166185L;
-
- private transient Object obj;
-
- /**
- * Create the ObjectMessage.
- * @param obj The Object to format.
- */
- public ObjectMessage(Object obj) {
- this.obj = obj;
- }
-
- /**
- * Return the formatted object message.
- * @return the formatted object message.
- */
- public String getFormattedMessage() {
- return obj.toString();
- }
-
- /**
- * Returns the object formatted using its toString method.
- * @return the String representation of the object.
- */
- public String getMessageFormat() {
- return obj.toString();
- }
-
- /**
- * Returns the object as if it were a parameter.
- * @return The object.
- */
- public Object[] getParameters() {
- return new Object[]{obj};
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- ObjectMessage that = (ObjectMessage) o;
-
- return !(obj != null ? !obj.equals(that.obj) : that.obj != null);
- }
-
- public int hashCode() {
- return obj != null ? obj.hashCode() : 0;
- }
-
- public String toString() {
- return "ObjectMessage[obj=" + obj.toString() + "]";
- }
-
- private void writeObject(ObjectOutputStream out) throws IOException {
- out.defaultWriteObject();
- if (obj instanceof Serializable) {
- out.writeObject(obj);
- } else {
- out.writeObject(obj.toString());
- }
- }
-
- private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
- in.defaultReadObject();
- obj = in.readObject();
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
deleted file mode 100644
index f324c41..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Handles messages that consist of a format string containing '{}' to represent each replaceable token, and
- * the parameters.
- * <p/>
- * This class was originally written for Lillith (http://mac.freshmeat.net/projects/lilith-viewer) by
- * Joern Huxhorn where it is licensed under the LGPL. It has been relicensed here with his permission
- * providing that this attribution remain.
- */
-public class ParameterizedMessage implements Message, Serializable {
-
- /**
- * Prefix for recursion.
- */
- public static final String RECURSION_PREFIX = "[...";
- /**
- * Suffix for recursion.
- */
- public static final String RECURSION_SUFFIX = "...]";
-
- /**
- * Prefix for errors.
- */
- public static final String ERROR_PREFIX = "[!!!";
- /**
- * Separator for errors.
- */
- public static final String ERROR_SEPARATOR = "=>";
- /**
- * Separator for error messages.
- */
- public static final String ERROR_MSG_SEPARATOR = ":";
- /**
- * Suffix for errors.
- */
- public static final String ERROR_SUFFIX = "!!!]";
-
- private static final long serialVersionUID = -665975803997290697L;
-
- private static final int HASHVAL = 31;
-
- private static final char DELIM_START = '{';
- private static final char DELIM_STOP = '}';
- private static final char ESCAPE_CHAR = '\\';
-
- private String messagePattern;
- private String[] stringArgs;
- private transient Object[] argArray;
- private transient String formattedMessage;
- private transient Throwable throwable;
-
- /**
- * Create the ParameterizedMessage.
- */
- public ParameterizedMessage() {
- this(null, null, null);
- }
-
- /**
- * Create the parameterizedMessage.
- * @param messagePattern The message "format" string. This will be a String containing "{}" placeholders
- * where parameters should be substituted.
- * @param stringArgs The arguments for substitution.
- * @param throwable A Throwable.
- */
- public ParameterizedMessage(String messagePattern, String[] stringArgs, Throwable throwable) {
- this.messagePattern = messagePattern;
- this.stringArgs = stringArgs;
- this.throwable = throwable;
- }
-
- public ParameterizedMessage(String messagePattern, Object[] arguments, Throwable throwable) {
- this.messagePattern = messagePattern;
- this.throwable = throwable;
- if (arguments != null) {
- parseArguments(arguments);
- }
- }
-
- /**
- * <p>This method returns a ParameterizedMessage which contains the arguments converted to String
- * as well as an optional Throwable.</p>
- * <p/>
- * <p>If the last argument is a Throwable and is NOT used up by a placeholder in the message pattern it is returned
- * in ParameterizedMessage.getThrowable() and won't be contained in the created String[].<br/>
- * If it is used up ParameterizedMessage.getThrowable() will return null even if the last argument was a
- * Throwable!</p>
- *
- * @param messagePattern the message pattern that to be checked for placeholders.
- * @param arguments the argument array to be converted.
- */
- public ParameterizedMessage(String messagePattern, Object[] arguments) {
- this.messagePattern = messagePattern;
- if (arguments == null) {
- return;
- }
- parseArguments(arguments);
- }
-
- /**
- * Constructor with a pattern and a single parameter.
- * @param messagePattern The message pattern.
- * @param arg The parameter.
- */
- public ParameterizedMessage(String messagePattern, Object arg) {
- this(messagePattern, new Object[]{arg});
- }
-
- /**
- * Constructor with a pattern and two parameters.
- * @param messagePattern The message pattern.
- * @param arg1 The first parameter.
- * @param arg2 The second parameter.
- */
- public ParameterizedMessage(String messagePattern, Object arg1, Object arg2) {
- this(messagePattern, new Object[]{arg1, arg2});
- }
-
- private void parseArguments(Object[] arguments) {
- int argsCount = countArgumentPlaceholders(messagePattern);
- int resultArgCount = arguments.length;
- if (argsCount < arguments.length) {
- if (throwable == null && arguments[arguments.length - 1] instanceof Throwable) {
- throwable = (Throwable) arguments[arguments.length - 1];
- resultArgCount--;
- }
- }
- argArray = new Object[resultArgCount];
- for (int i = 0; i < resultArgCount; ++i) {
- argArray[i] = arguments[i];
- }
-
- if (argsCount == 1 && throwable == null && arguments.length > 1) {
- // special case
- stringArgs = new String[1];
- stringArgs[0] = deepToString(arguments);
- } else {
- stringArgs = new String[resultArgCount];
- for (int i = 0; i < stringArgs.length; i++) {
- stringArgs[i] = deepToString(arguments[i]);
- }
- }
- }
-
- /**
- * Return the formatted message.
- * @return the formatted message.
- */
- public String getFormattedMessage() {
- if (formattedMessage == null) {
- formattedMessage = formatMessage(messagePattern, stringArgs);
- }
- return formattedMessage;
- }
-
- /**
- * Returns the message pattern.
- * @return the message pattern.
- */
- public String getMessageFormat() {
- return messagePattern;
- }
-
- /**
- * Set the message pattern.
- * @param messagePattern The message pattern.
- */
- public void setMessageFormat(String messagePattern) {
- this.messagePattern = messagePattern;
- this.formattedMessage = null;
- }
-
- /**
- * Returns the message parameters.
- * @return the message parameters.
- */
- public Object[] getParameters() {
- if (argArray != null) {
- return argArray;
- }
- return stringArgs;
- }
-
- /**
- * Sets the parameters for the message.
- * @param parameters The parameters.
- */
- public void setParameters(String[] parameters) {
- this.stringArgs = parameters;
- this.formattedMessage = null;
- }
-
- /**
- * Sets the parameters for the message.
- * @param parameters The parameters.
- */
- public void setParameters(Object[] parameters) {
- parseArguments(parameters);
- this.formattedMessage = null;
- }
-
- /**
- * Set the Throwable for the message.
- * @param throwable The Throwable.
- */
- public void setThrowable(Throwable throwable) {
- this.throwable = throwable;
- }
-
- /**
- * Returns the Throwable that was given as the last argument, if any.
- * It will not survive serialization. The Throwable exists as part of the message
- * primarily so that it can be extracted from the end of the list of parameters
- * and then be added to the LogEvent. As such, the Throwable in the event should
- * not be used once the LogEvent has been constructed.
- *
- * @return the Throwable, if any.
- */
- public Throwable getThrowable() {
- return throwable;
- }
-
- protected String formatMessage(String msgPattern, String[] sArgs) {
- return format(msgPattern, sArgs);
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- ParameterizedMessage that = (ParameterizedMessage) o;
-
- if (messagePattern != null ? !messagePattern.equals(that.messagePattern) : that.messagePattern != null) {
- return false;
- }
- if (!Arrays.equals(stringArgs, that.stringArgs)) {
- return false;
- }
- //if (throwable != null ? !throwable.equals(that.throwable) : that.throwable != null) return false;
-
- return true;
- }
-
- public int hashCode() {
- int result = messagePattern != null ? messagePattern.hashCode() : 0;
- result = HASHVAL * result + (stringArgs != null ? Arrays.hashCode(stringArgs) : 0);
- return result;
- }
-
- /**
- * Replace placeholders in the given messagePattern with arguments.
- *
- * @param messagePattern the message pattern containing placeholders.
- * @param arguments the arguments to be used to replace placeholders.
- * @return the formatted message.
- */
- public static String format(String messagePattern, Object[] arguments) {
- if (messagePattern == null || arguments == null || arguments.length == 0) {
- return messagePattern;
- }
-
- StringBuilder result = new StringBuilder();
- int escapeCounter = 0;
- int currentArgument = 0;
- for (int i = 0; i < messagePattern.length(); i++) {
- char curChar = messagePattern.charAt(i);
- if (curChar == ESCAPE_CHAR) {
- escapeCounter++;
- } else {
- if (curChar == DELIM_START) {
- if (i < messagePattern.length() - 1) {
- if (messagePattern.charAt(i + 1) == DELIM_STOP) {
- // write escaped escape chars
- int escapedEscapes = escapeCounter / 2;
- for (int j = 0; j < escapedEscapes; j++) {
- result.append(ESCAPE_CHAR);
- }
-
- if (escapeCounter % 2 == 1) {
- // i.e. escaped
- // write escaped escape chars
- result.append(DELIM_START);
- result.append(DELIM_STOP);
- } else {
- // unescaped
- if (currentArgument < arguments.length) {
- result.append(arguments[currentArgument]);
- } else {
- result.append(DELIM_START).append(DELIM_STOP);
- }
- currentArgument++;
- }
- i++;
- escapeCounter = 0;
- continue;
- }
- }
- }
- // any other char beside ESCAPE or DELIM_START/STOP-combo
- // write unescaped escape chars
- if (escapeCounter > 0) {
- for (int j = 0; j < escapeCounter; j++) {
- result.append(ESCAPE_CHAR);
- }
- escapeCounter = 0;
- }
- result.append(curChar);
- }
- }
- return result.toString();
- }
-
- /**
- * Counts the number of unescaped placeholders in the given messagePattern.
- *
- * @param messagePattern the message pattern to be analyzed.
- * @return the number of unescaped placeholders.
- */
- public static int countArgumentPlaceholders(String messagePattern) {
- if (messagePattern == null) {
- return 0;
- }
-
- int delim = messagePattern.indexOf(DELIM_START);
-
- if (delim == -1) {
- // special case, no placeholders at all.
- return 0;
- }
- int result = 0;
- boolean isEscaped = false;
- for (int i = 0; i < messagePattern.length(); i++) {
- char curChar = messagePattern.charAt(i);
- if (curChar == ESCAPE_CHAR) {
- isEscaped = !isEscaped;
- } else if (curChar == DELIM_START) {
- if (!isEscaped) {
- if (i < messagePattern.length() - 1) {
- if (messagePattern.charAt(i + 1) == DELIM_STOP) {
- result++;
- i++;
- }
- }
- }
- isEscaped = false;
- } else {
- isEscaped = false;
- }
- }
- return result;
- }
-
- /**
- * This method performs a deep toString of the given Object.
- * Primitive arrays are converted using their respective Arrays.toString methods while
- * special handling is implemented for "container types", i.e. Object[], Map and Collection because those could
- * contain themselves.
- * <p/>
- * It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a
- * behavior. They only check if the container is directly contained in itself, but not if a contained container
- * contains the original one. Because of that, Arrays.toString(Object[]) isn't safe either.
- * Confusing? Just read the last paragraph again and check the respective toString() implementation.
- * <p/>
- * This means, in effect, that logging would produce a usable output even if an ordinary System.out.println(o)
- * would produce a relatively hard-to-debug StackOverflowError.
- * @param o The object.
- * @return The String representation.
- */
- public static String deepToString(Object o) {
- if (o == null) {
- return null;
- }
- if (o instanceof String) {
- return (String) o;
- }
- StringBuilder str = new StringBuilder();
- Set<String> dejaVu = new HashSet<String>(); // that's actually a neat name ;)
- recursiveDeepToString(o, str, dejaVu);
- return str.toString();
- }
-
- /**
- * This method performs a deep toString of the given Object.
- * Primitive arrays are converted using their respective Arrays.toString methods while
- * special handling is implemented for "container types", i.e. Object[], Map and Collection because those could
- * contain themselves.
- * <p/>
- * dejaVu is used in case of those container types to prevent an endless recursion.
- * <p/>
- * It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a
- * behavior.
- * They only check if the container is directly contained in itself, but not if a contained container contains the
- * original one. Because of that, Arrays.toString(Object[]) isn't safe either.
- * Confusing? Just read the last paragraph again and check the respective toString() implementation.
- * <p/>
- * This means, in effect, that logging would produce a usable output even if an ordinary System.out.println(o)
- * would produce a relatively hard-to-debug StackOverflowError.
- *
- * @param o the Object to convert into a String
- * @param str the StringBuilder that o will be appended to
- * @param dejaVu a list of container identities that were already used.
- */
- private static void recursiveDeepToString(Object o, StringBuilder str, Set<String> dejaVu) {
- if (o == null) {
- str.append("null");
- return;
- }
- if (o instanceof String) {
- str.append(o);
- return;
- }
-
- Class oClass = o.getClass();
- if (oClass.isArray()) {
- if (oClass == byte[].class) {
- str.append(Arrays.toString((byte[]) o));
- } else if (oClass == short[].class) {
- str.append(Arrays.toString((short[]) o));
- } else if (oClass == int[].class) {
- str.append(Arrays.toString((int[]) o));
- } else if (oClass == long[].class) {
- str.append(Arrays.toString((long[]) o));
- } else if (oClass == float[].class) {
- str.append(Arrays.toString((float[]) o));
- } else if (oClass == double[].class) {
- str.append(Arrays.toString((double[]) o));
- } else if (oClass == boolean[].class) {
- str.append(Arrays.toString((boolean[]) o));
- } else if (oClass == char[].class) {
- str.append(Arrays.toString((char[]) o));
- } else {
- // special handling of container Object[]
- String id = identityToString(o);
- if (dejaVu.contains(id)) {
- str.append(RECURSION_PREFIX).append(id).append(RECURSION_SUFFIX);
- } else {
- dejaVu.add(id);
- Object[] oArray = (Object[]) o;
- str.append("[");
- boolean first = true;
- for (Object current : oArray) {
- if (first) {
- first = false;
- } else {
- str.append(", ");
- }
- recursiveDeepToString(current, str, new HashSet<String>(dejaVu));
- }
- str.append("]");
- }
- //str.append(Arrays.deepToString((Object[]) o));
- }
- } else if (o instanceof Map) {
- // special handling of container Map
- String id = identityToString(o);
- if (dejaVu.contains(id)) {
- str.append(RECURSION_PREFIX).append(id).append(RECURSION_SUFFIX);
- } else {
- dejaVu.add(id);
- Map oMap = (Map) o;
- str.append("{");
- boolean isFirst = true;
- for (Object o1 : oMap.entrySet()) {
- Map.Entry current = (Map.Entry) o1;
- if (isFirst) {
- isFirst = false;
- } else {
- str.append(", ");
- }
- Object key = current.getKey();
- Object value = current.getValue();
- recursiveDeepToString(key, str, new HashSet<String>(dejaVu));
- str.append("=");
- recursiveDeepToString(value, str, new HashSet<String>(dejaVu));
- }
- str.append("}");
- }
- } else if (o instanceof Collection) {
- // special handling of container Collection
- String id = identityToString(o);
- if (dejaVu.contains(id)) {
- str.append(RECURSION_PREFIX).append(id).append(RECURSION_SUFFIX);
- } else {
- dejaVu.add(id);
- Collection oCol = (Collection) o;
- str.append("[");
- boolean isFirst = true;
- for (Object anOCol : oCol) {
- if (isFirst) {
- isFirst = false;
- } else {
- str.append(", ");
- }
- recursiveDeepToString(anOCol, str, new HashSet<String>(dejaVu));
- }
- str.append("]");
- }
- } else if (o instanceof Date) {
- Date date = (Date) o;
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
- // I'll leave it like this for the moment... this could probably be optimized using ThreadLocal...
- str.append(format.format(date));
- } else {
- // it's just some other Object, we can only use toString().
- try {
- str.append(o.toString());
- } catch (Throwable t) {
- str.append(ERROR_PREFIX);
- str.append(identityToString(o));
- str.append(ERROR_SEPARATOR);
- String msg = t.getMessage();
- String className = t.getClass().getName();
- str.append(className);
- if (!className.equals(msg)) {
- str.append(ERROR_MSG_SEPARATOR);
- str.append(msg);
- }
- str.append(ERROR_SUFFIX);
- }
- }
- }
-
- /**
- * This method returns the same as if Object.toString() would not have been
- * overridden in obj.
- * <p/>
- * Note that this isn't 100% secure as collisions can always happen with hash codes.
- * <p/>
- * Copied from Object.hashCode():
- * As much as is reasonably practical, the hashCode method defined by
- * class <tt>Object</tt> does return distinct integers for distinct
- * objects. (This is typically implemented by converting the internal
- * address of the object into an integer, but this implementation
- * technique is not required by the
- * Java<font size="-2"><sup>TM</sup></font>
- * programming language.)
- *
- * @param obj the Object that is to be converted into an identity string.
- * @return the identity string as also defined in Object.toString()
- */
- public static String identityToString(Object obj) {
- if (obj == null) {
- return null;
- }
- return obj.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(obj));
- }
-
- public String toString() {
- return "ParameterizedMessage[messagePattern=" + messagePattern + ", stringArgs=" +
- Arrays.toString(stringArgs) + ", throwable=" + throwable + "]";
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
deleted file mode 100644
index a38b0d7..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.Serializable;
-
-/**
- * The simplest possible implementation of Message. It just returns the String given as the constructor argument.
- */
-public class SimpleMessage implements Message, Serializable {
- private static final long serialVersionUID = -8398002534962715992L;
-
- private final String message;
-
- /**
- * Basic constructor.
- */
- public SimpleMessage() {
- this(null);
- }
-
- /**
- * Constructor that includes the message.
- * @param message The String message.
- */
- public SimpleMessage(String message) {
- this.message = message;
- }
-
- /**
- * Return the message.
- * @return the message.
- */
- public String getFormattedMessage() {
- return message;
- }
-
- /**
- * Return the message.
- * @return the message.
- */
- public String getMessageFormat() {
- return message;
- }
-
- /**
- * Returns null since there are no parameters.
- * @return null.
- */
- public Object[] getParameters() {
- return null;
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- SimpleMessage that = (SimpleMessage) o;
-
- return !(message != null ? !message.equals(that.message) : that.message != null);
- }
-
- public int hashCode() {
- return message != null ? message.hashCode() : 0;
- }
-
- public String toString() {
- return "SimpleMessage[message=" + message + "]";
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
deleted file mode 100644
index bc3553e..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.Serializable;
-
-/**
- * The StructuredData identifier.
- */
-public class StructuredDataId implements Serializable {
-
- /**
- * RFC 5424 Time Quality.
- */
- public static final StructuredDataId TIME_QUALITY = new StructuredDataId("timeQuality", null,
- new String[]{"tzKnown", "isSynced", "syncAccuracy"});
- /**
- * RFC 5424 Origin.
- */
- public static final StructuredDataId ORIGIN = new StructuredDataId("origin", null,
- new String[]{"ip", "enterpriseId", "software", "swVersion"});
- /**
- * RFC 5424 Meta.
- */
- public static final StructuredDataId META = new StructuredDataId("meta", null,
- new String[]{"sequenceId", "sysUpTime", "language"});
-
- /**
- * Reserved enterprise number.
- */
- public static final int RESERVED = -1;
-
- private static final long serialVersionUID = 9031746276396249990L;
- private static final int MAX_LENGTH = 32;
-
- private final String name;
- private final int enterpriseNumber;
- private final String[] required;
- private final String[] optional;
-
-
- protected StructuredDataId(String name, String[] required, String[] optional) {
- int index = -1;
- if (name != null) {
- if (name.length() > MAX_LENGTH) {
- throw new IllegalArgumentException("Length of id exceeds maximum of 32 characters: " + name);
- }
- index = name.indexOf("@");
- }
-
- if (index > 0) {
- this.name = name.substring(0, index);
- this.enterpriseNumber = Integer.parseInt(name.substring(index + 1));
- } else {
- this.name = name;
- this.enterpriseNumber = RESERVED;
- }
- this.required = required;
- this.optional = optional;
- }
-
- /**
- * A Constructor that helps conformance to RFC 5424.
- *
- * @param name The name portion of the id.
- * @param enterpriseNumber The enterprise number.
- * @param required The list of keys that are required for this id.
- * @param optional The list of keys that are optional for this id.
- */
- public StructuredDataId(String name, int enterpriseNumber, String[] required, String[] optional) {
- if (name == null) {
- throw new IllegalArgumentException("No structured id name was supplied");
- }
- if (name.contains("@")) {
- throw new IllegalArgumentException("Structured id name cannot contain an '@");
- }
- if (enterpriseNumber <= 0) {
- throw new IllegalArgumentException("No enterprise number was supplied");
- }
- this.name = name;
- this.enterpriseNumber = enterpriseNumber;
- String id = enterpriseNumber < 0 ? name : name + "@" + enterpriseNumber;
- if (id.length() > MAX_LENGTH) {
- throw new IllegalArgumentException("Length of id exceeds maximum of 32 characters: " + id);
- }
- this.required = required;
- this.optional = optional;
- }
-
- /**
- * Creates an id using another id to supply default values.
- * @param id The original StructuredDataId.
- * @return the new StructuredDataId.
- */
- public StructuredDataId makeId(StructuredDataId id) {
- if (id == null) {
- return this;
- }
- return makeId(id.getName(), id.getEnterpriseNumber());
- }
-
- /**
- * Creates an id based on the current id.
- * @param defaultId The default id to use if this StructuredDataId doesn't have a name.
- * @param enterpriseNumber The enterprise number.
- * @return a StructuredDataId.
- */
- public StructuredDataId makeId(String defaultId, int enterpriseNumber) {
- String id;
- String[] req;
- String[] opt;
- if (enterpriseNumber <= 0) {
- return this;
- }
- if (this.name != null) {
- id = this.name;
- req = this.required;
- opt = this.optional;
- } else {
- id = defaultId;
- req = null;
- opt = null;
- }
-
- return new StructuredDataId(id, enterpriseNumber, req, opt);
- }
-
- /**
- * Returns a list of required keys.
- * @return a List of required keys or null if none have been provided.
- */
- public String[] getRequired() {
- return required;
- }
-
- /**
- * Returns a list of optional keys.
- * @return a List of optional keys or null if none have been provided.
- */
- public String[] getOptional() {
- return optional;
- }
-
- /**
- * Return the StructuredDataId name.
- * @return the StructuredDataId name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Return the enterprise number.
- * @return the enterprise number.
- */
- public int getEnterpriseNumber() {
- return enterpriseNumber;
- }
-
- /**
- * Indicates if the id is reserved.
- * @return true if the id uses the reserved enterprise number, false otherwise.
- */
- public boolean isReserved() {
- return enterpriseNumber <= 0;
- }
-
- public String toString() {
- return isReserved() ? name : name + "@" + enterpriseNumber;
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
deleted file mode 100644
index 9500d73..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.Serializable;
-import java.util.Map;
-
-/**
- * Represents a Message that conforms to RFC 5424 (http://tools.ietf.org/html/rfc5424).
- */
-public class StructuredDataMessage extends MapMessage implements FormattedMessage, Serializable {
- /**
- * Full message format includes the type and message.
- */
- public static final String FULL = "full";
-
- private static final long serialVersionUID = 1703221292892071920L;
- private static final int MAX_LENGTH = 32;
- private static final int HASHVAL = 31;
-
- private StructuredDataId id;
-
- private String message;
-
- private String type;
-
- /**
- * Constructor based on a String id.
- * @param id The String id.
- * @param msg The message.
- * @param type The message type.
- */
- public StructuredDataMessage(final String id, final String msg, final String type) {
- this.id = new StructuredDataId(id, null, null);
- this.message = msg;
- this.type = type;
- }
- /**
- * Constructor based on a String id.
- * @param id The String id.
- * @param msg The message.
- * @param type The message type.
- * @param data The StructuredData map.
- */
- public StructuredDataMessage(final String id, final String msg, final String type,
- Map<String, String> data) {
- super(data);
- this.id = new StructuredDataId(id, null, null);
- this.message = msg;
- this.type = type;
- }
-
- /**
- * Constructor based on a StructuredDataId.
- * @param id The StructuredDataId.
- * @param msg The message.
- * @param type The message type.
- */
- public StructuredDataMessage(final StructuredDataId id, final String msg, final String type) {
- this.id = id;
- this.message = msg;
- this.type = type;
- }
-
- /**
- * Constructor based on a StructuredDataId.
- * @param id The StructuredDataId.
- * @param msg The message.
- * @param type The message type.
- * @param data The StructuredData map.
- */
- public StructuredDataMessage(final StructuredDataId id, final String msg, final String type,
- Map<String, String> data) {
- super(data);
- this.id = id;
- this.message = msg;
- this.type = type;
- }
-
-
- /**
- * Constructor based on a StructuredDataMessage.
- * @param msg The StructuredDataMessage.
- * @param map The StructuredData map.
- */
- private StructuredDataMessage(StructuredDataMessage msg, Map<String, String> map) {
- super(map);
- this.id = msg.id;
- this.message = msg.message;
- this.type = msg.type;
- }
-
-
- /**
- * Basic constructor.
- */
- protected StructuredDataMessage() {
-
- }
-
- /**
- * Return the id.
- * @return the StructuredDataId.
- */
- public StructuredDataId getId() {
- return id;
- }
-
- /**
- * Set the id from a String.
- * @param id The String id.
- */
- protected void setId(String id) {
- this.id = new StructuredDataId(id, null, null);
- }
-
- /**
- * Set the id.
- * @param id The StructuredDataId.
- */
- protected void setId(StructuredDataId id) {
- this.id = id;
- }
-
- /**
- * Set the type.
- * @return the type.
- */
- public String getType() {
- return type;
- }
-
- protected void setType(String type) {
- if (type.length() > MAX_LENGTH) {
- throw new IllegalArgumentException("Structured data type exceeds maximum length of 32 characters: " + type);
- }
- this.type = type;
- }
- /**
- * Return the message.
- * @return the message.
- */
- public String getMessageFormat() {
- return message;
- }
-
- protected void setMessageFormat(String msg) {
- this.message = msg;
- }
-
-
- @Override
- protected void validate(String key, String value) {
- if (value.length() > MAX_LENGTH) {
- throw new IllegalArgumentException("Structured data values are limited to 32 characters. key: " + key +
- " value: " + value);
- }
- }
-
- /**
- * Format the Structured data as described in RFC 5424.
- *
- * @return The formatted String.
- */
- @Override
- public String asString() {
- return asString(FULL, null);
- }
-
- /**
- * Format the Structured data as described in RFC 5424.
- *
- * @param format The format identifier. Ignored in this implementation.
- * @return The formatted String.
- */
-
- public String asString(String format) {
- return asString(format, null);
- }
-
- /**
- * Format the Structured data as described in RFC 5424.
- *
- * @param format "full" will include the type and message. null will return only the STRUCTURED-DATA as
- * described in RFC 5424
- * @param structuredDataId The SD-ID as described in RFC 5424. If null the value in the StructuredData
- * will be used.
- * @return The formatted String.
- */
- public final String asString(String format, StructuredDataId structuredDataId) {
- StringBuilder sb = new StringBuilder();
- boolean full = FULL.equals(format);
- if (full) {
- String type = getType();
- if (type == null) {
- return sb.toString();
- }
- sb.append(getType()).append(" ");
- }
- StructuredDataId id = getId();
- if (id != null) {
- id = id.makeId(structuredDataId);
- } else {
- id = structuredDataId;
- }
- if (id == null || id.getName() == null) {
- return sb.toString();
- }
- sb.append("[");
- sb.append(id);
- sb.append(" ");
- appendMap(sb);
- sb.append("]");
- if (full) {
- String msg = getMessageFormat();
- if (msg != null) {
- sb.append(" ").append(msg);
- }
- }
- return sb.toString();
- }
-
- /**
- * Format the message and return it.
- * @return the formatted message.
- */
- @Override
- public String getFormattedMessage() {
- return asString(FULL, null);
- }
-
- @Override
- public String toString() {
- return asString(null);
- }
-
-
- public MapMessage newInstance(Map<String, String> map) {
- return new StructuredDataMessage(this, map);
- }
-
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
-
- StructuredDataMessage that = (StructuredDataMessage) o;
-
- if (!super.equals(o)) {
- return false;
- }
- if (type != null ? !type.equals(that.type) : that.type != null) {
- return false;
- }
- if (id != null ? !id.equals(that.id) : that.id != null) {
- return false;
- }
- if (message != null ? !message.equals(that.message) : that.message != null) {
- return false;
- }
-
- return true;
- }
-
- public int hashCode() {
- int result = super.hashCode();
- result = HASHVAL * result + (type != null ? type.hashCode() : 0);
- result = HASHVAL * result + (id != null ? id.hashCode() : 0);
- result = HASHVAL * result + (message != null ? message.hashCode() : 0);
- return result;
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
deleted file mode 100644
index 8478438..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadDumpMessage.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import java.io.InvalidObjectException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.lang.management.ManagementFactory;
-import java.lang.management.ThreadInfo;
-import java.lang.management.ThreadMXBean;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Captures information about all running Threads.
- */
-public class ThreadDumpMessage implements Message {
-
- private static final long serialVersionUID = -1103400781608841088L;
-
- private static ThreadInfoFactory factory;
-
- private volatile Map<ThreadInformation, StackTraceElement[]> threads;
-
- private final String title;
-
- private String formattedMessage = null;
-
- static {
- Method[] methods = ThreadInfo.class.getMethods();
- boolean basic = true;
- for (Method method : methods) {
- if (method.getName().equals("getLockInfo")) {
- basic = false;
- break;
- }
- }
- factory = basic ? new BasicThreadInfoFactory() : new ExtendedThreadInfoFactory();
- }
-
- /**
- * Generate a ThreadDumpMessage with no title.
- */
- public ThreadDumpMessage() {
- this(null);
-
- }
-
- /**
- * Generate a ThreadDumpMessage with a title.
- * @param title The title.
- */
- public ThreadDumpMessage(String title) {
- this.title = title == null ? "" : title;
- threads = factory.createThreadInfo();
- }
-
- private ThreadDumpMessage(String formattedMsg, String title) {
- this.formattedMessage = formattedMsg;
- this.title = title;
- }
-
- /**
- * Return the ThreadDump in printable format.
- * @return the ThreadDump suitable for logging.
- */
- public String getFormattedMessage() {
- if (formattedMessage != null) {
- return formattedMessage;
- }
- StringBuilder sb = new StringBuilder(title);
- if (title.length() > 0) {
- sb.append("\n");
- }
- for (Map.Entry<ThreadInformation, StackTraceElement[]> entry : threads.entrySet()) {
- ThreadInformation info = entry.getKey();
- info.printThreadInfo(sb);
- info.printStack(sb, entry.getValue());
- sb.append("\n");
- }
- return sb.toString();
- }
-
- /**
- * Returns the title.
- * @return the title.
- */
- public String getMessageFormat() {
- return title == null ? "" : title;
- }
-
- /**
- * Returns an array with a single element, a Map containing the ThreadInformation as the key.
- * and the StackTraceElement array as the value;
- * @return the "parameters" to this Message.
- */
- public Object[] getParameters() {
- return null;
- }
-
- /**
- * Creates a ThreadDumpMessageProxy that can be serialized.
- * @return a ThreadDumpMessageProxy.
- */
- protected Object writeReplace() {
- return new ThreadDumpMessageProxy(this);
- }
-
- private void readObject(ObjectInputStream stream)
- throws InvalidObjectException {
- throw new InvalidObjectException("Proxy required");
- }
-
- /**
- * Proxy pattern used to serialize the ThreadDumpMessage.
- */
- private static class ThreadDumpMessageProxy implements Serializable {
-
- private static final long serialVersionUID = -3476620450287648269L;
- private String formattedMsg;
- private String title;
-
- public ThreadDumpMessageProxy(ThreadDumpMessage msg) {
- this.formattedMsg = msg.getFormattedMessage();
- this.title = msg.title;
- }
-
- /**
- * Return a ThreadDumpMessage using the data in the proxy.
- * @return a ThreadDumpMessage.
- */
- protected Object readResolve() {
- return new ThreadDumpMessage(formattedMsg, title);
- }
- }
-
- /**
- * Factory to create Thread information.
- */
- private interface ThreadInfoFactory {
- Map<ThreadInformation, StackTraceElement[]> createThreadInfo();
- }
-
- /**
- * Factory to create basic thread information.
- */
- private static class BasicThreadInfoFactory implements ThreadInfoFactory {
- public Map<ThreadInformation, StackTraceElement[]> createThreadInfo() {
- Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces();
- Map<ThreadInformation, StackTraceElement[]> threads =
- new HashMap<ThreadInformation, StackTraceElement[]>(map.size());
- for (Map.Entry<Thread, StackTraceElement[]> entry : map.entrySet()) {
- threads.put(new BasicThreadInformation(entry.getKey()), entry.getValue());
- }
- return threads;
- }
- }
-
- /**
- * Factory to create extended thread information.
- */
- private static class ExtendedThreadInfoFactory implements ThreadInfoFactory {
- public Map<ThreadInformation, StackTraceElement[]> createThreadInfo() {
- ThreadMXBean bean = ManagementFactory.getThreadMXBean();
- ThreadInfo[] array = bean.dumpAllThreads(true, true);
-
- Map<ThreadInformation, StackTraceElement[]> threads =
- new HashMap<ThreadInformation, StackTraceElement[]>(array.length);
- for (ThreadInfo info : array) {
- threads.put(new ExtendedThreadInformation(info), info.getStackTrace());
- }
- return threads;
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
deleted file mode 100644
index 2db1777..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ThreadInformation.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Interface used to print basic or extended thread information.
- */
-interface ThreadInformation {
- /**
- * Format the thread information into the provided StringBuilder.
- * @param sb The StringBuilder.
- */
- void printThreadInfo(StringBuilder sb);
-
- /**
- * Format the stack trace into the provided StringBuilder.
- * @param sb The StringBuilder.
- * @param trace The stack trace element array to format.
- */
- void printStack(StringBuilder sb, StackTraceElement[] trace);
-
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/TimestampMessage.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/TimestampMessage.java
deleted file mode 100644
index ad43010..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/TimestampMessage.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-/**
- * Messages that use this interface will cause the timestamp in the message to be used instead of the timestmap in
- * the LogEvent.
- */
-public interface TimestampMessage {
- /**
- * Returns the timestamp.
- * @return The timestamp.
- */
- long getTimestamp();
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java
deleted file mode 100644
index b45f64b..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-/**
- * Public Message Types used for Log4j 2.0. User's may implement their own Messages.
- */
-package org.apache.logging.log4j.message;
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java
deleted file mode 100644
index add24ea..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-/**
- * Public API for Log4j 2.0.
- */
-package org.apache.logging.log4j;
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
deleted file mode 100644
index e9e8041..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
+++ /dev/null
@@ -1,1480 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.spi;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.MarkerManager;
-import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.message.ObjectMessage;
-import org.apache.logging.log4j.message.ParameterizedMessage;
-import org.apache.logging.log4j.message.SimpleMessage;
-
-/**
- * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
- *
- * @doubt See Jira LOG4J2-39.
- */
-public abstract class AbstractLogger implements Logger {
-
- /**
- * Marker for flow tracing.
- */
- public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW");
- /**
- * Marker for method entry tracing.
- */
- public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTRY", FLOW_MARKER);
- /**
- * Marker for method exit tracing.
- */
- public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT", FLOW_MARKER);
- /**
- * Marker for exception tracing.
- */
- public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION");
- /**
- * Marker for throwing exceptions.
- */
- public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING", EXCEPTION_MARKER);
- /**
- * Marker for catching exceptions.
- */
- public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING", EXCEPTION_MARKER);
-
- private static final String FQCN = AbstractLogger.class.getName();
-
- /**
- * Log entry to a method.
- */
- public void entry() {
- if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
- log(ENTRY_MARKER, FQCN, Level.TRACE, new SimpleMessage(" entry"), null);
- }
- }
-
-
- /**
- * Log entry to a method.
- *
- * @param params The parameters to the method.
- */
- public void entry(Object... params) {
- if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
- log(ENTRY_MARKER, FQCN, Level.TRACE, entryMsg(params.length, params), null);
- }
- }
-
- /**
- * Log exit from a method.
- */
- public void exit() {
- if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) {
- log(EXIT_MARKER, FQCN, Level.TRACE, exitMsg(null), null);
- }
- }
-
- /**
- * Log exiting from a method with the result.
- *
- * @param result The result being returned from the method call.
- * @return the Throwable.
- */
- public <R> R exit(R result) {
- if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) {
- log(EXIT_MARKER, FQCN, Level.TRACE, exitMsg(result), null);
- }
- return result;
- }
-
- /**
- * Log an exception or error to be thrown.
- *
- * @param t The Throwable.
- * @return the Throwable.
- */
- public <T extends Throwable> T throwing(T t) {
- if (isEnabled(Level.ERROR, THROWING_MARKER, (Object) null, null)) {
- log(THROWING_MARKER, FQCN, Level.ERROR, new SimpleMessage("throwing"), t);
- }
- return t;
- }
-
-
- /**
- * Log an exception or error to be thrown.
- *
- * @param level The logging Level.
- * @param t The Throwable.
- * @return the Throwable.
- */
- public <T extends Throwable> T throwing(Level level, T t) {
- if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
- log(THROWING_MARKER, FQCN, level, new SimpleMessage("throwing"), t);
- }
- return t;
- }
-
- /**
- * Log an exception or error that has been caught.
- *
- * @param t The Throwable.
- */
- public void catching(Throwable t) {
- if (isEnabled(Level.DEBUG, THROWING_MARKER, (Object) null, null)) {
- log(THROWING_MARKER, FQCN, Level.DEBUG, new SimpleMessage("catching"), t);
- }
- }
-
- /**
- * Log an exception or error that has been caught.
- *
- * @param level The logging Level.
- * @param t The Throwable.
- */
- public void catching(Level level, Throwable t) {
- if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
- log(THROWING_MARKER, FQCN, level, new SimpleMessage("catching"), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param message the message object to log.
- */
- public void trace(String message) {
- if (isEnabled(Level.TRACE, null, message)) {
- log(null, FQCN, Level.TRACE, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void trace(Marker marker, String message) {
- if (isEnabled(Level.TRACE, marker, message)) {
- log(marker, FQCN, Level.TRACE, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void trace(String message, Throwable t) {
- if (isEnabled(Level.TRACE, null, message, t)) {
- log(null, FQCN, Level.TRACE, new SimpleMessage(message), t);
- }
- }
-
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void trace(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.TRACE, marker, message, t)) {
- log(marker, FQCN, Level.TRACE, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param message the message object to log.
- */
- public void trace(Object message) {
- if (isEnabled(Level.TRACE, null, message, null)) {
- log(null, FQCN, Level.TRACE, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#TRACE TRACE} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void trace(Marker marker, Object message) {
- if (isEnabled(Level.TRACE, marker, message, null)) {
- log(marker, FQCN, Level.TRACE, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void trace(Object message, Throwable t) {
- if (isEnabled(Level.TRACE, null, message, t)) {
- log(null, FQCN, Level.TRACE, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>TRACE</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- * <p/>
- * <p>
- * See {@link #debug(String)} form for more detailed information.
- * </p>
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void trace(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.TRACE, marker, message, t)) {
- log(marker, FQCN, Level.TRACE, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>TRACE</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void trace(String message, Object... params) {
- if (isEnabled(Level.TRACE, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.TRACE, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>TRACE</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void trace(Marker marker, String message, Object... params) {
- if (isEnabled(Level.TRACE, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.TRACE, msg, msg.getThrowable());
- }
- }
-
- /**
- * Check whether this Logger is enabled for the TRACE Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * TRACE, <code>false</code> otherwise.
- */
- public boolean isTraceEnabled() {
- return isEnabled(Level.TRACE, null, (Object) null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the TRACE Level.
- *
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * TRACE, <code>false</code> otherwise.
- */
- public boolean isTraceEnabled(Marker marker) {
- return isEnabled(Level.TRACE, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- */
- public void trace(Message msg) {
- if (isEnabled(Level.TRACE, null, msg, null)) {
- log(null, FQCN, Level.TRACE, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void trace(Message msg, Throwable t) {
- if (isEnabled(Level.TRACE, null, msg, t)) {
- log(null, FQCN, Level.TRACE, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param marker the marker data specific to this log statement.
- * @param msg the message string to be logged
- */
- public void trace(Marker marker, Message msg) {
- if (isEnabled(Level.TRACE, marker, msg, null)) {
- log(marker, FQCN, Level.TRACE, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param marker the marker data specific to this log statement.
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void trace(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.TRACE, marker, msg, t)) {
- log(marker, FQCN, Level.TRACE, msg, t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param message the message object to log.
- */
- public void debug(String message) {
- if (isEnabled(Level.DEBUG, null, message)) {
- log(null, FQCN, Level.DEBUG, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void debug(Marker marker, String message) {
- if (isEnabled(Level.DEBUG, marker, message)) {
- log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- public void debug(String message, Throwable t) {
- if (isEnabled(Level.DEBUG, null, message, t)) {
- log(null, FQCN, Level.DEBUG, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- public void debug(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.DEBUG, marker, message, t)) {
- log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), t);
- }
- }
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param message the message object to log.
- */
- public void debug(Object message) {
- if (isEnabled(Level.DEBUG, null, message, null)) {
- log(null, FQCN, Level.DEBUG, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#DEBUG DEBUG} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void debug(Marker marker, Object message) {
- if (isEnabled(Level.DEBUG, marker, message, null)) {
- log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- public void debug(Object message, Throwable t) {
- if (isEnabled(Level.DEBUG, null, message, t)) {
- log(null, FQCN, Level.DEBUG, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>DEBUG</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param t the exception to log, including its stack trace.
- */
- public void debug(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.DEBUG, marker, message, t)) {
- log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>DEBUG</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void debug(String message, Object... params) {
- if (isEnabled(Level.DEBUG, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.DEBUG, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>DEBUG</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void debug(Marker marker, String message, Object... params) {
- if (isEnabled(Level.DEBUG, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.DEBUG, msg, msg.getThrowable());
- }
- }
-
- /**
- * Check whether this Logger is enabled for the DEBUG Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * DEBUG, <code>false</code> otherwise.
- */
- public boolean isDebugEnabled() {
- return isEnabled(Level.DEBUG, null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the DEBUG Level.
- *
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * DEBUG, <code>false</code> otherwise.
- */
- public boolean isDebugEnabled(Marker marker) {
- return isEnabled(Level.DEBUG, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param msg the message string to be logged
- */
- public void debug(Message msg) {
- if (isEnabled(Level.TRACE, null, msg, null)) {
- log(null, FQCN, Level.TRACE, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void debug(Message msg, Throwable t) {
- if (isEnabled(Level.TRACE, null, msg, t)) {
- log(null, FQCN, Level.TRACE, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- public void debug(Marker marker, Message msg) {
- if (isEnabled(Level.DEBUG, marker, msg, null)) {
- log(marker, FQCN, Level.DEBUG, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the DEBUG level.
- *
- * @param marker the marker data specific to this log statement.
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void debug(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.DEBUG, marker, msg, t)) {
- log(marker, FQCN, Level.DEBUG, msg, t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param message the message object to log.
- */
- public void info(String message) {
- if (isEnabled(Level.INFO, null, message)) {
- log(null, FQCN, Level.INFO, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void info(Marker marker, String message) {
- if (isEnabled(Level.INFO, marker, message)) {
- log(marker, FQCN, Level.INFO, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void info(String message, Throwable t) {
- if (isEnabled(Level.INFO, null, message, t)) {
- log(null, FQCN, Level.INFO, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void info(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.INFO, marker, message, t)) {
- log(marker, FQCN, Level.INFO, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param message the message object to log.
- */
- public void info(Object message) {
- if (isEnabled(Level.INFO, null, message, null)) {
- log(null, FQCN, Level.INFO, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#INFO INFO} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void info(Marker marker, Object message) {
- if (isEnabled(Level.INFO, marker, message, null)) {
- log(marker, FQCN, Level.INFO, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void info(Object message, Throwable t) {
- if (isEnabled(Level.INFO, null, message, t)) {
- log(null, FQCN, Level.INFO, new ObjectMessage(message), t);
- }
- }
-
-
- /**
- * Log a message at the <code>INFO</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void info(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.INFO, marker, message, t)) {
- log(marker, FQCN, Level.INFO, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>INFO</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void info(String message, Object... params) {
- if (isEnabled(Level.INFO, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.INFO, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>INFO</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void info(Marker marker, String message, Object... params) {
- if (isEnabled(Level.INFO, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.INFO, msg, msg.getThrowable());
- }
- }
-
- /**
- * Check whether this Logger is enabled for the INFO Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * INFO, <code>false</code> otherwise.
- */
- public boolean isInfoEnabled() {
- return isEnabled(Level.INFO, null, (Object) null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the INFO Level.
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * INFO, <code>false</code> otherwise.
- */
- public boolean isInfoEnabled(Marker marker) {
- return isEnabled(Level.INFO, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the TRACE level.
- *
- * @param msg the message string to be logged
- */
- public void info(Message msg) {
- if (isEnabled(Level.INFO, null, msg, null)) {
- log(null, FQCN, Level.INFO, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void info(Message msg, Throwable t) {
- if (isEnabled(Level.INFO, null, msg, t)) {
- log(null, FQCN, Level.INFO, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- public void info(Marker marker, Message msg) {
- if (isEnabled(Level.INFO, null, msg, null)) {
- log(marker, FQCN, Level.INFO, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the INFO level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void info(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.INFO, marker, msg, t)) {
- log(marker, FQCN, Level.INFO, msg, t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param message the message object to log.
- */
- public void warn(String message) {
- if (isEnabled(Level.WARN, null, message)) {
- log(null, FQCN, Level.WARN, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void warn(Marker marker, String message) {
- if (isEnabled(Level.WARN, marker, message)) {
- log(marker, FQCN, Level.WARN, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void warn(String message, Throwable t) {
- if (isEnabled(Level.WARN, null, message, t)) {
- log(null, FQCN, Level.DEBUG, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void warn(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.WARN, marker, message, t)) {
- log(marker, FQCN, Level.DEBUG, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void warn(Marker marker, Object message) {
- if (isEnabled(Level.WARN, marker, message, null)) {
- log(marker, FQCN, Level.WARN, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#WARN WARN} level.
- *
- * @param message the message object to log.
- */
- public void warn(Object message) {
- if (isEnabled(Level.WARN, null, message, null)) {
- log(null, FQCN, Level.WARN, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void warn(Object message, Throwable t) {
- if (isEnabled(Level.WARN, null, message, t)) {
- log(null, FQCN, Level.DEBUG, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>WARN</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void warn(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.WARN, marker, message, t)) {
- log(marker, FQCN, Level.DEBUG, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>WARN</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void warn(String message, Object... params) {
- if (isEnabled(Level.WARN, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.WARN, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>WARN</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void warn(Marker marker, String message, Object... params) {
- if (isEnabled(Level.WARN, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.WARN, msg, msg.getThrowable());
- }
- }
-
- /**
- * Check whether this Logger is enabled for the WARN Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * WARN, <code>false</code> otherwise.
- */
- public boolean isWarnEnabled() {
- return isEnabled(Level.WARN, null, (Object) null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the WARN Level.
- *
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * WARN, <code>false</code> otherwise.
- */
- public boolean isWarnEnabled(Marker marker) {
- return isEnabled(Level.WARN, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param msg the message string to be logged
- */
- public void warn(Message msg) {
- if (isEnabled(Level.WARN, null, msg, null)) {
- log(null, FQCN, Level.WARN, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void warn(Message msg, Throwable t) {
- if (isEnabled(Level.WARN, null, msg, t)) {
- log(null, FQCN, Level.WARN, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- public void warn(Marker marker, Message msg) {
- if (isEnabled(Level.WARN, null, msg, null)) {
- log(marker, FQCN, Level.WARN, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the WARN level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void warn(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.WARN, marker, msg, t)) {
- log(marker, FQCN, Level.WARN, msg, t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param message the message object to log.
- */
- public void error(String message) {
- if (isEnabled(Level.ERROR, null, message)) {
- log(null, FQCN, Level.ERROR, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void error(Marker marker, String message) {
- if (isEnabled(Level.ERROR, marker, message)) {
- log(marker, FQCN, Level.ERROR, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void error(String message, Throwable t) {
- if (isEnabled(Level.ERROR, null, message, t)) {
- log(null, FQCN, Level.ERROR, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void error(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.ERROR, marker, message, t)) {
- log(marker, FQCN, Level.ERROR, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param message the message object to log.
- */
- public void error(Object message) {
- if (isEnabled(Level.ERROR, null, message, null)) {
- log(null, FQCN, Level.ERROR, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#ERROR ERROR} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void error(Marker marker, Object message) {
- if (isEnabled(Level.ERROR, marker, message, null)) {
- log(marker, FQCN, Level.ERROR, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void error(Object message, Throwable t) {
- if (isEnabled(Level.ERROR, null, message, t)) {
- log(null, FQCN, Level.ERROR, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>ERROR</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void error(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.ERROR, marker, message, t)) {
- log(marker, FQCN, Level.ERROR, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>ERROR</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void error(String message, Object... params) {
- if (isEnabled(Level.ERROR, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.ERROR, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>ERROR</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void error(Marker marker, String message, Object... params) {
- if (isEnabled(Level.ERROR, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.ERROR, msg, msg.getThrowable());
- }
- }
-
-
- /**
- * Check whether this Logger is enabled for the ERROR Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * ERROR, <code>false</code> otherwise.
- */
- public boolean isErrorEnabled() {
- return isEnabled(Level.ERROR, null, (Object) null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the ERROR Level.
- *
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * ERROR, <code>false</code> otherwise.
- */
- public boolean isErrorEnabled(Marker marker) {
- return isEnabled(Level.ERROR, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param msg the message string to be logged
- */
- public void error(Message msg) {
- if (isEnabled(Level.ERROR, null, msg, null)) {
- log(null, FQCN, Level.ERROR, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void error(Message msg, Throwable t) {
- if (isEnabled(Level.ERROR, null, msg, t)) {
- log(null, FQCN, Level.ERROR, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- public void error(Marker marker, Message msg) {
- if (isEnabled(Level.ERROR, null, msg, null)) {
- log(null, FQCN, Level.ERROR, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the ERROR level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void error(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.TRACE, marker, msg, t)) {
- log(marker, FQCN, Level.TRACE, msg, t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param message the message object to log.
- */
- public void fatal(String message) {
- if (isEnabled(Level.FATAL, null, message)) {
- log(null, FQCN, Level.FATAL, new SimpleMessage(message), null);
- }
- }
-
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void fatal(Marker marker, String message) {
- if (isEnabled(Level.FATAL, marker, message)) {
- log(marker, FQCN, Level.FATAL, new SimpleMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void fatal(String message, Throwable t) {
- if (isEnabled(Level.FATAL, null, message, t)) {
- log(null, FQCN, Level.FATAL, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void fatal(Marker marker, String message, Throwable t) {
- if (isEnabled(Level.FATAL, marker, message, t)) {
- log(marker, FQCN, Level.FATAL, new SimpleMessage(message), t);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param message the message object to log.
- */
- public void fatal(Object message) {
- if (isEnabled(Level.FATAL, null, message, null)) {
- log(null, FQCN, Level.FATAL, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message object with the {@link org.apache.logging.log4j.Level#FATAL FATAL} level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- */
- public void fatal(Marker marker, Object message) {
- if (isEnabled(Level.FATAL, marker, message, null)) {
- log(marker, FQCN, Level.FATAL, new ObjectMessage(message), null);
- }
- }
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void fatal(Object message, Throwable t) {
- if (isEnabled(Level.FATAL, null, message, t)) {
- log(null, FQCN, Level.FATAL, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message at the <code>FATAL</code> level including the
- * stack trace of the {@link Throwable}<code>t</code> passed as parameter.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message object to log.
- * @param t the exception to log, including its stack trace.
- */
- public void fatal(Marker marker, Object message, Throwable t) {
- if (isEnabled(Level.FATAL, marker, message, t)) {
- log(marker, FQCN, Level.FATAL, new ObjectMessage(message), t);
- }
- }
-
- /**
- * Log a message with parameters at the <code>FATAL</code> level.
- *
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void fatal(String message, Object... params) {
- if (isEnabled(Level.FATAL, null, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(null, FQCN, Level.FATAL, msg, msg.getThrowable());
- }
- }
-
- /**
- * Log a message with parameters at the <code>FATAL</code> level.
- *
- * @param marker the marker data specific to this log statement.
- * @param message the message to log.
- * @param params parameters to the message.
- */
- public void fatal(Marker marker, String message, Object... params) {
- if (isEnabled(Level.FATAL, marker, message, params)) {
- ParameterizedMessage msg = new ParameterizedMessage(message, params);
- log(marker, FQCN, Level.FATAL, msg, msg.getThrowable());
- }
- }
-
- /**
- * Check whether this Logger is enabled for the FATAL Level.
- *
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * FATAL, <code>false</code> otherwise.
- */
- public boolean isFatalEnabled() {
- return isEnabled(Level.ERROR, null, (Object) null, null);
- }
-
- /**
- * Check whether this Logger is enabled for the FATAL Level.
- *
- * @param marker The marker data.
- * @return boolean - <code>true</code> if this Logger is enabled for level
- * FATAL, <code>false</code> otherwise.
- */
- public boolean isFatalEnabled(Marker marker) {
- return isEnabled(Level.FATAL, marker, (Object) null, null);
- }
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param msg the message string to be logged
- */
- public void fatal(Message msg) {
- if (isEnabled(Level.FATAL, null, msg, null)) {
- log(null, FQCN, Level.FATAL, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void fatal(Message msg, Throwable t) {
- if (isEnabled(Level.FATAL, null, msg, t)) {
- log(null, FQCN, Level.FATAL, msg, t);
- }
- }
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- */
- public void fatal(Marker marker, Message msg) {
- if (isEnabled(Level.FATAL, null, msg, null)) {
- log(null, FQCN, Level.FATAL, msg, null);
- }
- }
-
- /**
- * Log a message with the specific Marker at the FATAL level.
- *
- * @param marker the marker data specific to this log statement
- * @param msg the message string to be logged
- * @param t A Throwable or null.
- */
- public void fatal(Marker marker, Message msg, Throwable t) {
- if (isEnabled(Level.FATAL, marker, msg, t)) {
- log(marker, FQCN, Level.FATAL, msg, t);
- }
- }
-
- /**
- * Log a message with location information.
- *
- * @param marker The Marker
- * @param fqcn The fully qualified class name of the <b>caller</b>
- * @param level The logging level
- * @param data The Message.
- * @param t A Throwable or null.
- */
- protected abstract void log(Marker marker, String fqcn, Level level, Message data, Throwable t);
-
- /*
- * Instead of one single method with Object... declared the following methods explicitly specify
- * parameters because they perform dramatically better than having the JVM convert them to an
- * array.
- */
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param t A Throwable.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data, Throwable t);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @param p3 The third parameter.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3);
-
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @param p3 The third parameter.
- * @param params More message parameters.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2,
- Object p3, Object... params);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param t A Throwable.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, Object data, Throwable t);
-
- /**
- * Determine if logging is enabled.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The Message.
- * @param t A Throwable.
- * @return True if logging is enabled, false otherwise.
- */
- protected abstract boolean isEnabled(Level level, Marker marker, Message data, Throwable t);
-
- private Message entryMsg(int count, Object... params) {
- if (count == 0) {
- return new SimpleMessage(" entry");
- }
- StringBuilder sb = new StringBuilder(" entry parms(");
- int i = 0;
- for (Object parm : params) {
- if (parm != null) {
- sb.append(parm.toString());
- } else {
- sb.append("null");
- }
- if (++i < params.length) {
- sb.append(", ");
- }
- }
- sb.append(")");
- return new SimpleMessage(sb.toString());
- }
-
- private Message exitMsg(Object result) {
- if (result == null) {
- return new SimpleMessage(" exit");
- }
- return new SimpleMessage(" exit with (" + result + ")");
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java
deleted file mode 100644
index 65c875a..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.spi;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.message.Message;
-
-/**
- * Wrapper class that exposes the protected AbstractLogger methods to support wrapped loggers.
- */
-public class AbstractLoggerWrapper extends AbstractLogger {
-
- /**
- * The wrapped Logger.
- */
- protected final AbstractLogger logger;
- /**
- * The name of the Logger.
- */
- protected final String name;
-
- /**
- * Constructor that wraps and existing Logger.
- * @param logger The Logger to wrap.
- * @param name The name of the Logger.
- */
- public AbstractLoggerWrapper(AbstractLogger logger, String name) {
- this.logger = logger;
- this.name = name;
- }
-
- /**
- * Log an event.
- * @param marker The Marker
- * @param fqcn The fully qualified class name of the <b>caller</b>
- * @param level The logging level
- * @param data The Message.
- * @param t A Throwable or null.
- */
- @Override
- public void log(Marker marker, String fqcn, Level level, Message data, Throwable t) {
- logger.log(marker, fqcn, level, data, t);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @return true if the event would be logged for the Level, Marker and data, false otherwise.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data) {
- return logger.isEnabled(level, marker, data);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param t A Throwable.
- * @return true if the event would be logged for the Level, Marker, data and Throwable, false otherwise.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data, Throwable t) {
- return logger.isEnabled(level, marker, data, t);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @return true if the event would be logged for the Level, Marker, data and parameter.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data, Object p1) {
- return logger.isEnabled(level, marker, data, p1);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @return true if the event would be logged for the Level, Marker, data and parameters.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2) {
- return logger.isEnabled(level, marker, data, p1, p2);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @param p3 The third parameter.
- * @return true if the event would be logged for the Level, Marker, data and parameters.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3) {
- return logger.isEnabled(level, marker, data, p1, p2, p3);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param p1 The first parameter.
- * @param p2 The second parameter.
- * @param p3 The third parameter.
- * @param params More message parameters.
- * @return true if the event would be logged for the Level, Marker, data and parameters.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3,
- Object... params) {
- return logger.isEnabled(level, marker, data, p2, p2, p3, params);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The message.
- * @param t A Throwable.
- * @return true if the event would be logged for the Level, Marker, Object and Throwable, false otherwise.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, Object data, Throwable t) {
- return logger.isEnabled(level, marker, data, t);
- }
-
- /**
- * Detect if the event would be logged.
- * @param level The logging Level to check.
- * @param marker A Marker or null.
- * @param data The Message.
- * @param t A Throwable.
- * @return true if the event would be logged for the Level, Marker, Message and Throwable, false otherwise.
- */
- @Override
- public boolean isEnabled(Level level, Marker marker, Message data, Throwable t) {
- return logger.isEnabled(level, marker, data, t);
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
deleted file mode 100644
index e8c39a1..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.spi;
-
-import org.apache.logging.log4j.Logger;
-
-/**
- * Anchor point for logging implementations.
- */
-public interface LoggerContext {
-
- /**
- * Return a Logger.
- * @param name The name of the Logger to return.
- * @return The logger with the specified name.
- */
- Logger getLogger(String name);
-
- /**
- * Detect if a Logger with the specified name exists.
- * @param name The Logger name to search for.
- * @return true if the Logger exists, false otherwise.
- */
- boolean hasLogger(String name);
-
- /**
- * An anchor for some other context, such as a ServletContext.
- * @return The external context.
- */
- Object getExternalContext();
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java
deleted file mode 100644
index 79bc945..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.spi;
-
-/**
- * Interface implemented by factories that create LoggerContext objects.
- */
-public interface LoggerContextFactory {
-
- /**
- * @param fqcn The fully qualified class name of the caller.
- * @param currentContext If true returns the current Context, if false returns the Context appropriate
- * for the caller if a more appropriate Context can be determined.
- * @return The LoggerContext.
- */
- LoggerContext getContext(String fqcn, boolean currentContext);
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java
deleted file mode 100644
index 7de8836..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-/**
- * Internal interfaces and classes to be used by authors of logging implementations.
- */
-package org.apache.logging.log4j.spi;
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java
deleted file mode 100644
index 39824da..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.status;
-
-import org.apache.logging.log4j.Level;
-
-/**
- * StatusListener that writes to the Console.
- */
-public class StatusConsoleListener implements StatusListener {
-
- private static final String STATUS_LEVEL = "org.apache.logging.log4j.StatusLevel";
-
- private Level level = Level.FATAL;
-
- private String[] filters = null;
-
- /**
- * Creates the StatusConsoleListener using either the level configured by the
- * "org.apache.logging.log4j.StatusLevel" system property if it is set or to a
- * default value of FATAL.
- */
- public StatusConsoleListener() {
- String str = System.getProperty(STATUS_LEVEL);
- if (str != null) {
- level = Level.toLevel(str, Level.FATAL);
- }
- }
-
- /**
- * Creates the StatusConsoleListener using the supplied Level.
- * @param level The Level of status messages that should appear on the console.
- */
- public StatusConsoleListener(Level level) {
- this.level = level;
- }
-
- /**
- * Sets the level to a new value.
- * @param level The new Level.
- */
- public void setLevel(Level level) {
- this.level = level;
- }
-
- /**
- * Writes status messages to the console.
- * @param data The StatusData.
- */
- public void log(StatusData data) {
- if (data.getLevel().isAtLeastAsSpecificAs(level) && !filtered(data)) {
- System.out.println(data.getFormattedStatus());
- }
- }
-
- /**
- * Adds package name filters to exclude.
- * @param filters An array of package names to exclude.
- */
- public void setFilters(String[] filters) {
- this.filters = filters;
- }
-
- private boolean filtered(StatusData data) {
- if (filters == null) {
- return false;
- }
- String caller = data.getStackTraceElement().getClassName();
- for (String filter : filters) {
- if (caller.startsWith(filter)) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
deleted file mode 100644
index 6921cd4..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.status;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.message.Message;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * The Status data.
- */
-public class StatusData {
-
- private final long timestamp;
-
- private final StackTraceElement caller;
-
- private final Level level;
-
- private final Message msg;
-
- private final Throwable throwable;
-
- /**
- * Creates the StatusData object.
- * @param caller The method that created the event.
- * @param level The logging level.
- * @param msg The message String.
- * @param t The Error or Exception that occurred.
- */
- public StatusData(StackTraceElement caller, Level level, Message msg, Throwable t) {
- this.timestamp = System.currentTimeMillis();
- this.caller = caller;
- this.level = level;
- this.msg = msg;
- this.throwable = t;
- }
-
- /**
- * Return the event's timestamp.
- * @return The event's timestamp.
- */
- public long getTimestamp() {
- return timestamp;
- }
-
- /**
- * Returns the StackTraceElement for the method that created the event.
- * @return The StackTraceElement.
- */
- public StackTraceElement getStackTraceElement() {
- return caller;
- }
-
- /**
- * Returns the logging level for the event.
- * @return The logging level.
- */
- public Level getLevel() {
- return level;
- }
-
- /**
- * Returns the message associated with the event.
- * @return The message associated with the event.
- */
- public Message getMessage() {
- return msg;
- }
-
- /**
- * Returns the Throwable associated with the event.
- * @return The Throwable associated with the event.
- */
- public Throwable getThrowable() {
- return throwable;
- }
-
- /**
- * Formats the StatusData for viewing.
- * @return The formatted status data as a String.
- */
- public String getFormattedStatus() {
- StringBuilder sb = new StringBuilder();
- SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
- sb.append(format.format(new Date(timestamp)));
- sb.append(" ");
- sb.append(level.toString());
- sb.append(" ");
- sb.append(msg.getFormattedMessage());
- Object[] params = msg.getParameters();
- Throwable t;
- if (throwable == null && params != null && params[params.length - 1] instanceof Throwable) {
- t = (Throwable) params[params.length - 1];
- } else {
- t = throwable;
- }
- if (t != null) {
- sb.append(" ");
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- t.printStackTrace(new PrintStream(baos));
- sb.append(baos.toString());
- }
- return sb.toString();
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java
deleted file mode 100644
index 887f167..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.status;
-
-/**
- * Interface that allows implementors to be notified of events in the logging system.
- */
-public interface StatusListener {
-
- /**
- * Called as events occur to process the StatusData.
- * @param data The StatusData for the event.
- */
- void log(StatusData data);
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
deleted file mode 100644
index 098d7d4..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.status;
-
-import org.apache.logging.log4j.spi.AbstractLogger;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.message.Message;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-/**
- * Mechanism to record events that occur in the logging system.
- */
-public final class StatusLogger extends AbstractLogger {
-
- /**
- * System property that can be configured with the number of entries in the queue. Once the limit
- * is reached older entries will be removed as new entries are added.
- */
- public static final String MAX_STATUS_ENTRIES = "log4j2.status.entries";
-
- private static final String NOT_AVAIL = "?";
-
- private static final int MAX_ENTRIES = Integer.getInteger(MAX_STATUS_ENTRIES, 200);
-
- // private static final String FQCN = AbstractLogger.class.getName();
-
- private static StatusLogger statusLogger = new StatusLogger();
-
- private Logger logger = null;
-
- private CopyOnWriteArrayList<StatusListener> listeners = new CopyOnWriteArrayList<StatusListener>();
- private ReentrantReadWriteLock listenersLock = new ReentrantReadWriteLock();
-
- private Queue<StatusData> messages = new BoundedQueue<StatusData>(MAX_ENTRIES);
- private ReentrantLock msgLock = new ReentrantLock();
-
- private StatusLogger() {
- }
-
- /**
- * Retrieve the StatusLogger.
- * @return The StatusLogger.
- */
- public static StatusLogger getLogger() {
- return statusLogger;
- }
-
- /**
- * Register a new listener.
- * @param listener The StatusListener to register.
- */
- public void registerListener(StatusListener listener) {
- listenersLock.writeLock().lock();
- try {
- listeners.add(listener);
- } finally {
- listenersLock.writeLock().unlock();
- }
- }
-
- /**
- * Remove a StatusListener.
- * @param listener The StatusListener to remove.
- */
- public void removeListener(StatusListener listener) {
- listenersLock.writeLock().lock();
- try {
- listeners.remove(listener);
- } finally {
- listenersLock.writeLock().unlock();
- }
- }
-
- /**
- * Returns a thread safe Iterator for the StatusListener.
- * @return An Iterator for the list of StatusListeners.
- */
- public Iterator<StatusListener> getListeners() {
- return listeners.iterator();
- }
-
- /**
- * Clears the list of status events and listeners.
- */
- public void reset() {
- listeners.clear();
- clear();
- }
-
- /**
- * Returns a List of all events as StatusData objects.
- * @return The list of StatusData objects.
- */
- public List<StatusData> getStatusData() {
- msgLock.lock();
- try {
- return new ArrayList<StatusData>(messages);
- } finally {
- msgLock.unlock();
- }
- }
-
- /**
- * Clears the list of status events.
- */
- public void clear() {
- msgLock.lock();
- try {
- messages.clear();
- } finally {
- msgLock.unlock();
- }
- }
-
-
- /**
- * Add an event.
- * @param marker The Marker
- * @param fqcn The fully qualified class name of the <b>caller</b>
- * @param level The logging level
- * @param msg The message associated with the event.
- * @param t A Throwable or null.
- */
- @Override
- public void log(Marker marker, String fqcn, Level level, Message msg, Throwable t) {
- StackTraceElement element = null;
- if (fqcn != null) {
- element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace());
- }
- StatusData data = new StatusData(element, level, msg, t);
- msgLock.lock();
- try {
- messages.add(data);
- } finally {
- msgLock.unlock();
- }
- for (StatusListener listener : listeners) {
- listener.log(data);
- }
- }
-
- private StackTraceElement getStackTraceElement(String fqcn, StackTraceElement[] stackTrace) {
- if (fqcn == null) {
- return null;
- }
- boolean next = false;
- for (StackTraceElement element : stackTrace) {
- if (next) {
- return element;
- }
- String className = element.getClassName();
- if (fqcn.equals(className)) {
- next = true;
- } else if (NOT_AVAIL.equals(className)) {
- break;
- }
- }
- return null;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data, Throwable t) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data, Object p1) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String data, Object p1, Object p2, Object p3,
- Object... params) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, Object data, Throwable t) {
- return isEnabled(level, marker);
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, Message data, Throwable t) {
- return isEnabled(level, marker);
- }
-
- protected boolean isEnabled(Level level, Marker marker) {
- if (logger == null) {
- return true;
- }
- switch (level) {
- case FATAL:
- return logger.isFatalEnabled(marker);
- case TRACE:
- return logger.isTraceEnabled(marker);
- case DEBUG:
- return logger.isDebugEnabled(marker);
- case INFO:
- return logger.isInfoEnabled(marker);
- case WARN:
- return logger.isWarnEnabled(marker);
- case ERROR:
- return logger.isErrorEnabled(marker);
- }
- return false;
- }
-
- /**
- * Queue for status events.
- * @param <E> Object type to be stored in the queue.
- */
- private class BoundedQueue<E> extends ConcurrentLinkedQueue<E> {
-
- private final int size;
-
- public BoundedQueue(int size) {
- this.size = size;
- }
-
- public boolean add(E object) {
- while (messages.size() > size) {
- messages.poll();
- }
- return super.add(object);
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java b/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java
deleted file mode 100644
index f4d2c45..0000000
--- a/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-/** Status API for Log4j 2.0. Should not be used by typical applications performing logging but may be
- * used by applications reporting on the status of the logging system
- */
-package org.apache.logging.log4j.status;
diff --git a/rgoers/log4j2-api/src/main/resources/LICENSE b/rgoers/log4j2-api/src/main/resources/LICENSE
deleted file mode 100644
index 6279e52..0000000
--- a/rgoers/log4j2-api/src/main/resources/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 1999-2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/rgoers/log4j2-api/src/main/resources/NOTICE b/rgoers/log4j2-api/src/main/resources/NOTICE
deleted file mode 100644
index 6233b56..0000000
--- a/rgoers/log4j2-api/src/main/resources/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache log4j Enhanced PatternLayout for log4j 1.2.x
-Copyright 2007 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/rgoers/log4j2-api/src/site/site.xml b/rgoers/log4j2-api/src/site/site.xml
deleted file mode 100644
index 832d7b8..0000000
--- a/rgoers/log4j2-api/src/site/site.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project name="Component">
- <bannerLeft>
- <name>Logging Services</name>
- <src>../images/ls-logo.jpg</src>
- <href>../index.html</href>
- </bannerLeft>
- <bannerRight>
- <src>../images/logo.jpg</src>
- </bannerRight>
- <body>
- <links>
- <item name="Apache" href="http://www.apache.org/" />
- <item name="Logging Services" href="http://logging.apache.org/"/>
- <item name="Log4j" href="../index.html"/>
- </links>
- <menu ref="reports"/>
- </body>
-</project>
diff --git a/rgoers/log4j2-api/src/site/xdoc/index.xml b/rgoers/log4j2-api/src/site/xdoc/index.xml
deleted file mode 100644
index b3bfbb5..0000000
--- a/rgoers/log4j2-api/src/site/xdoc/index.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<document>
- <properties>
- <title>Log4J 2.0 API</title>
- <author email="rgoers@apache.org">Ralph Goers</author>
- </properties>
-
- <body>
- <section name="Log4j 2.0 API">
-
- <p>
- The Log4Jj 2.0 API provides the interface that applications should code to and provides the
- adapter components required for implementers to create a logging implementation.
- </p>
-
- </section>
-
- <section name="Requirements">
- <p>
- The Log4j 2.0 API requires at least Java 5.
- </p>
- </section>
-
- </body>
-</document>
\ No newline at end of file
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java
deleted file mode 100644
index 40b7489..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/EventLoggerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.message.StructuredDataMessage;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.List;
-import java.util.Locale;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-/**
- *
- */
-public class EventLoggerTest {
-
- SimpleLogger logger = (SimpleLogger) LogManager.getLogger("EventLogger");
- List<String> results = logger.getEntries();
-
- @Before
- public void setup() {
- results.clear();
- }
-
- @Test
- public void structuredData() {
- ThreadContext.put("loginId", "JohnDoe");
- ThreadContext.put("ipAddress", "192.168.0.120");
- ThreadContext.put("locale", Locale.US.getDisplayName());
- StructuredDataMessage msg = new StructuredDataMessage("Transfer@18060", "Transfer Complete", "Audit");
- msg.put("ToAccount", "123456");
- msg.put("FromAccount", "123457");
- msg.put("Amount", "200.00");
- EventLogger.logEvent(msg);
- ThreadContext.clear();
- assertEquals(1, results.size());
- String expected = " OFF Audit [Transfer@18060 Amount=\"200.00\" FromAccount=\"123457\" ToAccount=\"123456\"] Transfer Complete";
- assertTrue("Incorrect structured data: " + results.get(0) + ", expected: " ,results.get(0).startsWith(expected));
- }
-
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LevelTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LevelTest.java
deleted file mode 100644
index 959021c..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LevelTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-/**
- *
- */
-public class LevelTest {
-
- @Test
- public void testGoodLevels() {
- Level level = Level.toLevel("INFO");
- assertNotNull(level);
- assertEquals(Level.INFO, level);
- }
-
- @Test
- public void testDefault() {
- Level level = Level.toLevel("Information", Level.ERROR);
- assertNotNull(level);
- assertEquals(Level.ERROR, level);
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
deleted file mode 100644
index 4dcdf40..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.message.StructuredDataMessage;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
-
-/**
- *
- */
-public class LoggerTest {
-
- SimpleLogger logger = (SimpleLogger) LogManager.getLogger("LoggerTest");
- List<String> results = logger.getEntries();
-
- @Before
- public void setup() {
- results.clear();
- }
-
- @Test
- public void basicFlow() {
- logger.entry();
- logger.exit();
- assertEquals(2, results.size());
- assertTrue("Incorrect Entry", results.get(0).startsWith(" TRACE entry"));
- assertTrue("incorrect Exit", results.get(1).startsWith(" TRACE exit"));
-
- }
-
- @Test
- public void throwing() {
- logger.throwing(new IllegalArgumentException("Test Exception"));
- assertEquals(1, results.size());
- assertTrue("Incorrect Throwing",
- results.get(0).startsWith(" ERROR throwing java.lang.IllegalArgumentException: Test Exception"));
- }
-
- @Test
- public void catching() {
- try {
- throw new NullPointerException();
- } catch (Exception e) {
- logger.catching(e);
- assertEquals(1, results.size());
- assertTrue("Incorrect Catching",
- results.get(0).startsWith(" DEBUG catching java.lang.NullPointerException"));
- }
- }
-
- @Test
- public void debug() {
- logger.debug("Debug message");
- assertEquals(1, results.size());
- assertTrue("Incorrect message", results.get(0).startsWith(" DEBUG Debug message"));
- }
-
- @Test
- public void debugObject() {
- logger.debug(new Date());
- assertEquals(1, results.size());
- assertTrue("Invalid length", results.get(0).length() > 7);
- }
-
- @Test
- public void debugWithParms() {
- logger.debug("Hello, {}", "World");
- assertEquals(1, results.size());
- assertTrue("Incorrect substitution", results.get(0).startsWith(" DEBUG Hello, World"));
- }
-
- @Test
- public void debugWithParmsAndThrowable() {
- logger.debug("Hello, {}", "World", new RuntimeException("Test Exception"));
- assertEquals(1, results.size());
- assertTrue("Unexpected results: " + results.get(0),
- results.get(0).startsWith(" DEBUG Hello, World java.lang.RuntimeException: Test Exception"));
- }
-
- @Test
- public void mdc() {
-
- ThreadContext.put("TestYear", new Integer(2010).toString());
- logger.debug("Debug message");
- ThreadContext.clear();
- logger.debug("Debug message");
- assertEquals(2, results.size());
- assertTrue("Incorrect MDC: " + results.get(0),
- results.get(0).startsWith(" DEBUG Debug message {TestYear=2010}"));
- assertTrue("MDC not cleared?: " + results.get(1),
- results.get(1).startsWith(" DEBUG Debug message"));
- }
-
- @Test
- public void structuredData() {
- ThreadContext.put("loginId", "JohnDoe");
- ThreadContext.put("ipAddress", "192.168.0.120");
- ThreadContext.put("locale", Locale.US.getDisplayName());
- StructuredDataMessage msg = new StructuredDataMessage("Audit@18060", "Transfer Complete", "Transfer");
- msg.put("ToAccount", "123456");
- msg.put("FromAccount", "123457");
- msg.put("Amount", "200.00");
- logger.info(MarkerManager.getMarker("EVENT"), msg);
- ThreadContext.clear();
- assertEquals(1, results.size());
- assertTrue("Incorrect structured data: " + results.get(0),results.get(0).startsWith(
- " INFO Transfer [Audit@18060 Amount=\"200.00\" FromAccount=\"123457\" ToAccount=\"123456\"] Transfer Complete"));
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java
deleted file mode 100644
index 8c54d45..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.spi.AbstractLogger;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- */
-public class SimpleLogger extends AbstractLogger {
- private List<String> array = new ArrayList<String>();
-
- public List<String> getEntries() {
- return array;
- }
-
- @Override
- public void log(Marker marker, String fqcn, Level level, Message msg, Throwable throwable) {
- StringBuilder sb = new StringBuilder();
- sb.append(" ");
- sb.append(level.toString());
- sb.append(" ");
- sb.append(msg.getFormattedMessage());
- Map<String, String> mdc = ThreadContext.getContext();
- if (mdc.size() > 0) {
- sb.append(" ");
- sb.append(mdc.toString());
- sb.append(" ");
- }
- Object[] params = msg.getParameters();
- Throwable t;
- if (throwable == null && params != null && params[params.length -1] instanceof Throwable ) {
- t = (Throwable) params[params.length - 1];
- } else {
- t = throwable;
- }
- if (t != null) {
- sb.append(" ");
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- t.printStackTrace(new PrintStream(baos));
- sb.append(baos.toString());
- }
- array.add(sb.toString());
- //System.out.println(sb.toString());
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2, Object p3,
- Object...params) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg) {
- return true;
- }
-
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg, Throwable t) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg, Object p1) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2, Object p3) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, Object msg, Throwable t) {
- return true;
- }
-
- @Override
- protected boolean isEnabled(Level level, Marker marker, Message msg, Throwable t) {
- return true;
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java
deleted file mode 100644
index c7d5e79..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.spi.LoggerContext;
-
-/**
- *
- */
-public class SimpleLoggerContext implements LoggerContext {
- private Logger logger = new SimpleLogger();
-
- public Logger getLogger(String name) {
- return logger;
- }
-
- public boolean hasLogger(String name) {
- return false;
- }
-
- public Object getExternalContext() {
- return null;
- }
-
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContextFactory.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContextFactory.java
deleted file mode 100644
index 13c622d..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContextFactory.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j;
-
-import org.apache.logging.log4j.spi.LoggerContext;
-import org.apache.logging.log4j.spi.LoggerContextFactory;
-
-/**
- *
- */
-public class SimpleLoggerContextFactory implements LoggerContextFactory {
-
- private static LoggerContext ctx = new SimpleLoggerContext();
-
- public LoggerContext getContext(String FQCN, boolean currentContext) {
- return ctx;
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
deleted file mode 100644
index b4b6d82..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/MapMessageTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- *
- */
-public class MapMessageTest {
-
- @Test
- public void testMap() {
- String testMsg = "Test message {}";
- MapMessage msg = new MapMessage();
- msg.put("message", testMsg);
- msg.put("project", "Log4j");
- String result = msg.getFormattedMessage();
- String expected = "message=\"Test message {}\" project=\"Log4j\"";
- assertEquals(expected, result);
- }
-
- @Test
- public void testXML() {
- String testMsg = "Test message {}";
- MapMessage msg = new MapMessage();
- msg.setFormat("XML");
- msg.put("message", testMsg);
- msg.put("project", "Log4j");
- String result = msg.getFormattedMessage();
- String expected = "<Map>\n <Entry key=message>Test message {}</Entry>\n" +
- " <Entry key=project>Log4j</Entry>\n" +
- "</Map>";
- assertEquals(expected, result);
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java
deleted file mode 100644
index 111f016..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ParameterizedMessageTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- *
- */
-public class ParameterizedMessageTest {
-
- @Test
- public void testNoArgs() {
- String testMsg = "Test message {}";
- ParameterizedMessage msg = new ParameterizedMessage(testMsg, null);
- String result = msg.getFormattedMessage();
- assertEquals(testMsg, result);
- Object[] array = null;
- msg = new ParameterizedMessage(testMsg, array, null);
- result = msg.getFormattedMessage();
- assertEquals(testMsg, result);
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java
deleted file mode 100644
index 3f5eea9..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/StructuredDataMessageTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- *
- */
-public class StructuredDataMessageTest {
-
- @Test
- public void testMsg() {
- String testMsg = "Test message {}";
- StructuredDataMessage msg = new StructuredDataMessage("MsgId@12345", testMsg, "Alert");
- msg.put("message", testMsg);
- msg.put("project", "Log4j");
- String result = msg.getFormattedMessage();
- String expected = "Alert [MsgId@12345 message=\"Test message {}\" project=\"Log4j\"] Test message {}";
- assertEquals(expected, result);
- }
-}
diff --git a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java b/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java
deleted file mode 100644
index 120429f..0000000
--- a/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/message/ThreadDumpMessageTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.message;
-
-import org.junit.Test;
-
-import java.util.concurrent.locks.ReentrantLock;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- *
- */
-public class ThreadDumpMessageTest {
-
- @Test
- public void testMessage() {
- ThreadDumpMessage msg = new ThreadDumpMessage("Testing");
-
- String message = msg.getFormattedMessage();
- //System.out.print(message);
- assertTrue("No header", message.contains("Testing"));
- assertTrue("No RUNNABLE", message.contains("RUNNABLE"));
- assertTrue("No ThreadDumpMessage", message.contains("ThreadDumpMessage"));
- }
-
-
- @Test
- public void testMessageWithLocks() throws Exception {
- ReentrantLock lock = new ReentrantLock();
- lock.lock();
- Thread thread1 = new Thread1(lock);
- thread1.start();
- ThreadDumpMessage msg;
- synchronized(this) {
- Thread thread2 = new Thread2(this);
- thread2.start();
- try {
- Thread.sleep(200);
- msg = new ThreadDumpMessage("Testing");
- } finally {
- lock.unlock();
- }
- }
-
- String message = msg.getFormattedMessage();
- //System.out.print(message);
- assertTrue("No header", message.contains("Testing"));
- assertTrue("No RUNNABLE", message.contains("RUNNABLE"));
- assertTrue("No ThreadDumpMessage", message.contains("ThreadDumpMessage"));
- //assertTrue("No Locks", message.contains("waiting on"));
- //assertTrue("No syncronizers", message.contains("locked syncrhonizers"));
- }
-
- private class Thread1 extends Thread {
- private ReentrantLock lock;
-
- public Thread1(ReentrantLock lock) {
- this.lock = lock;
- }
-
- @Override
- public void run() {
- lock.lock();
- lock.unlock();
- }
- }
-
- private class Thread2 extends Thread {
- private Object obj;
-
- public Thread2(Object obj) {
- this.obj = obj;
- }
-
- @Override
- public void run() {
- synchronized (obj) {
-
- }
- }
- }
-}
diff --git a/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml b/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml
deleted file mode 100644
index 7284f25..0000000
--- a/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
-<properties>
- <entry key="LoggerContextFactory">org.apache.logging.log4j.SimpleLoggerContextFactory</entry>
- <entry key="Log4jAPIVersion">1.99.0</entry>
-</properties>
\ No newline at end of file
diff --git a/rgoers/log4j2-core/LICENSE b/rgoers/log4j2-core/LICENSE
deleted file mode 100644
index 6279e52..0000000
--- a/rgoers/log4j2-core/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 1999-2005 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/rgoers/log4j2-core/NOTICE b/rgoers/log4j2-core/NOTICE
deleted file mode 100644
index 6233b56..0000000
--- a/rgoers/log4j2-core/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache log4j Enhanced PatternLayout for log4j 1.2.x
-Copyright 2007 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/rgoers/log4j2-core/build.xml b/rgoers/log4j2-core/build.xml
deleted file mode 100644
index 5b987de..0000000
--- a/rgoers/log4j2-core/build.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-<!--
-
-This is a minimal build file to support Gump.
-Use of Maven to build this component is recommended.
-
--->
-<project default="test">
- <!-- use build.properties file or command line to override these properties -->
- <property file="build.properties"/>
-
- <!-- project details -->
- <property name="project.name" value="apache-log4j-experimental-pattern-layout"/>
- <property name="project.title" value="Enhanced Pattern Layout Component for log4j X"/>
- <property name="project.version" value="0.1-SNAPSHOT"/>
- <property name="project.jar" value="${project.name}-${project.version}.jar"/>
-
- <!-- Location of local Maven 2 repository -->
- <property name="m2_repo" location="${user.home}/.m2/repository"/>
-
- <!-- Versions for dependencies -->
- <property name="log4j.version" value="1.2.14"/>
- <property name="junit.version" value="4.3.1"/>
- <property name="oro.version" value="2.0.8"/>
-
- <!-- Dependency locations - assumed to be in Maven 2 repository -->
- <property name="junit.jar"
- location="${m2_repo}/junit/junit/${junit.version}/junit-${junit.version}.jar"/>
- <property name="log4j.jar"
- location="${m2_repo}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar"/>
- <property name="oro.jar"
- location="${m2_repo}/oro/oro/${oro.version}/oro-${oro.version}.jar"/>
-
-
- <!-- Java compiler settings -->
- <property name="javac.source" value="1.5"/>
- <property name="javac.target" value="1.5"/>
- <property name="javac.deprecation" value="true"/>
- <property name="javac.debug" value="true"/>
-
- <target name="init"/>
-
- <target name="clean" depends="init" description="Clean up generated files">
- <delete dir="target"/>
- </target>
-
-
- <target name="compile" depends="init" description="Compile implementation files">
- <mkdir dir="target/classes"/>
- <javac destdir="target/classes"
- srcdir="src/main/java"
- deprecation="${javac.deprecation}"
- debug="${javac.debug}"
- target="${javac.target}"
- source="${javac.source}"
- classpath="${log4j.jar}"/>
- <copy todir="target/classes">
- <fileset dir="src/main/resources"/>
- </copy>
- </target>
-
- <target name="jar" depends="compile" description="Create jar">
- <jar destfile="target/${project.jar}"
- basedir="target/classes">
- <manifest>
- <attribute name="Built-By" value="${user.name}"/>
- <section name="common">
- <attribute name="Specification-Title" value="${project.title}"/>
- <attribute name="Specification-Version" value="${project.version}"/>
- <attribute name="Specification-Vendor" value="Apache Software Foundation"/>
- <attribute name="Implementation-Title" value="${project.title}"/>
- <attribute name="Implementation-Version" value="${project.version}"/>
- <attribute name="Implementation-Vendor" value="Apache Software Foundation"/>
- </section>
- </manifest>
- </jar>
- </target>
-
- <target name="test-compile" depends="compile" description="Compile test files">
- <mkdir dir="target/test-classes"/>
- <javac destdir="target/test-classes"
- srcdir="src/test/java"
- deprecation="${javac.deprecation}"
- debug="${javac.debug}"
- target="${javac.target}"
- source="${javac.source}"
- classpath="${log4j.jar}:${junit.jar}:target/classes:${oro.jar}"/>
- <copy todir="target/test-classes">
- <fileset dir="src/test/resources"/>
- </copy>
- </target>
-
-
- <target name="test" depends="test-compile" description="Run unit tests">
- <junit printsummary="yes">
- <classpath path="target/test-classes:target/classes:${log4j.jar}:${oro.jar}"/>
- <batchtest>
- <fileset dir="src/test/java/">
- <include name="**/*TestCase.java"/>
- <include name="**/*Test.java"/>
- </fileset>
- </batchtest>
- <formatter type="plain" usefile="false"/>
- </junit>
- </target>
-</project>
diff --git a/rgoers/log4j2-core/pom.xml b/rgoers/log4j2-core/pom.xml
deleted file mode 100644
index 220b7ab..0000000
--- a/rgoers/log4j2-core/pom.xml
+++ /dev/null
@@ -1,295 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2</artifactId>
- <version>1.99.0-SNAPSHOT</version>
- </parent>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-core</artifactId>
- <packaging>jar</packaging>
- <name>Log4J2 Core</name>
- <description>Log4j 2.0 Implementation.</description>
- <properties>
- <log4j.parent.dir>${basedir}/..</log4j.parent.dir>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.logging.rgoers</groupId>
- <artifactId>log4j2-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-core-asl</artifactId>
- <version>1.9.2</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.codehaus.jackson</groupId>
- <artifactId>jackson-mapper-asl</artifactId>
- <version>1.9.2</version>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>oro</groupId>
- <artifactId>oro</artifactId>
- <version>2.0.8</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-ext</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.7</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockejb</groupId>
- <artifactId>mockejb</artifactId>
- <version>0.6-beta2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.0</version>
- <optional>true</optional>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>always</forkMode>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.2.1</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <mainClass>org.apache.logging.log4j.core.config.plugins.PluginManager</mainClass>
- <arguments>
- <argument>${project.build.outputDirectory}</argument>
- </arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-changes-plugin</artifactId>
- <version>2.6</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>changes-report</report>
- </reports>
- </reportSet>
- </reportSets>
- <configuration>
- <issueLinkTemplate>%URL%/show_bug.cgi?id=%ISSUE%</issueLinkTemplate>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.7</version>
- <configuration>
- <!--<propertiesLocation>${vfs.parent.dir}/checkstyle.properties</propertiesLocation> -->
- <configLocation>${log4j.parent.dir}/checkstyle.xml</configLocation>
- <suppressionsLocation>${log4j.parent.dir}/checkstyle-suppressions.xml</suppressionsLocation>
- <enableRulesSummary>false</enableRulesSummary>
- <propertyExpansion>basedir=${basedir}</propertyExpansion>
- <propertyExpansion>licensedir=${log4j.parent.dir}/checkstyle-header.txt</propertyExpansion>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.8</version>
- <configuration>
- <!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating
- project -->
- <detectOfflineLinks>false</detectOfflineLinks>
- <linksource>true</linksource>
- <tags>
- <tag>
- <name>issue</name>
- <placement>a</placement>
- <head>JIRA issue:</head>
- </tag>
- <tag>
- <name>doubt</name>
- <placement>a</placement>
- <head>Troublesome:</head>
- </tag>
- <tag>
- <name>compare</name>
- <placement>a</placement>
- <head>Compare with:</head>
- </tag>
- </tags>
- </configuration>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>javadoc</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <threshold>Normal</threshold>
- <effort>Default</effort>
- <excludeFilterFile>findbugs-exclude-filter.xml</excludeFilterFile>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.3</version>
- <reportSets>
- <reportSet>
- <id>non-aggregate</id>
- <reports>
- <report>jxr</report>
- </reports>
- </reportSet>
- <reportSet>
- <id>aggregate</id>
- <reports>
- <report>aggregate</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>2.2</version>
- <reportSets>
- <reportSet>
- <!-- Disabled at it kills the site generation via a NoClassDefFoundError -->
- <reports/>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
- <profiles>
- <profile>
- <!-- http://www.yourkit.com/docs/80/help/agent.jsp -->
- <id>yourkit</id>
-
- <properties>
- <yourkit.home>/Applications/YourKit_Java_Profiler_8.0.17.app</yourkit.home>
- </properties>
- <dependencies>
- <dependency>
- <groupId>com.yourkit</groupId>
- <artifactId>yjp-controller-api-redist</artifactId>
- <version>8.0.17</version>
- <scope>system</scope>
- <systemPath>${yourkit.home}/lib/yjp-controller-api-redist.jar</systemPath>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <argLine>-agentpath:"${yourkit.home}/bin/mac/libyjpagent.jnilib"</argLine>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
-
diff --git a/rgoers/log4j2-core/src/changes/changes.xml b/rgoers/log4j2-core/src/changes/changes.xml
deleted file mode 100644
index b92a5c0..0000000
--- a/rgoers/log4j2-core/src/changes/changes.xml
+++ /dev/null
Binary files differ
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/AbstractServer.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/AbstractServer.java
deleted file mode 100644
index 692c354..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/AbstractServer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import org.apache.logging.log4j.LogManager;
-
-/**
- *
- */
-public class AbstractServer {
-
- private LoggerContext context;
-
- protected AbstractServer() {
- context = (LoggerContext) LogManager.getContext();
- }
-
- protected void log(LogEvent event) {
- Logger logger = context.getLogger(event.getLoggerName());
- if (logger.config.filter(event.getLevel(), event.getMarker(), event.getMessage(), event.getThrown())) {
- logger.config.logEvent(event);
- }
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Appender.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Appender.java
deleted file mode 100644
index 67abdf7..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Appender.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-/**
- * @issue LOG4J2-36: Appender interface should be refactored
- */
-public interface Appender extends Lifecycle {
-
- /**
- * Log in <code>Appender</code> specific way. When appropriate,
- * Loggers will call the <code>doAppend</code> method of appender
- * implementations in order to log.
- *
- * @param event The LogEvent.
- */
- void append(LogEvent event);
-
-
- /**
- * Get the name of this appender.
- *
- * @return name, may be null.
- */
- String getName();
-
- /**
- * Returns this appenders layout.
- *
- * @return the Layout for the Appender or null if none is configured.
- * @issue LOG4J2-36 Refactor into Channel
- */
- Layout getLayout();
-
- /**
- * If set to true any exceptions thrown by the Appender will be logged but not thrown.
- * @return true if Exceptions should be suppressed, false otherwise.
- */
- boolean isExceptionSuppressed();
-
- ErrorHandler getHandler();
-
- void setHandler(ErrorHandler handler);
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/ErrorHandler.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/ErrorHandler.java
deleted file mode 100644
index bec0a20..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/ErrorHandler.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-/**
- * Appenders may delegate their error handling to <code>ErrorHandlers</code>.
- * @doubt if the appender interface is simplified, then error handling could just be done by wrapping
- * a nested appender. (RG) Please look at DefaultErrorHandler. It's purpose is to make sure the console
- * or error log isn't flooded with messages. I'm still considering the Appender refactoring.
- */
-public interface ErrorHandler {
-
- /**
- * Handle an error with a message.
- * @param msg The message.
- */
- void error(String msg);
-
- /**
- * Handle an error with a message and an exception.
- * @param msg The message.
- * @param t The Throwable.
- */
- void error(String msg, Throwable t);
-
- /**
- * Handle an error with a message, and exception and a logging event.
- * @param msg The message.
- * @param event The LogEvent.
- * @param t The Throwable.
- */
- void error(String msg, LogEvent event, Throwable t);
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Filter.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Filter.java
deleted file mode 100644
index 9168230..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Filter.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.message.Message;
-
-/**
- * Interface that must be implemented to allow custom event filtering. It is highly recommended that
- * applications make use of the Filters provided with this implementation before creating their own.
- *
- * This interface supports "global" filters (i.e. - all events must pass through them first), attached to
- * specific loggers and associated with Appenders. It is recommended that, where possible, Filter implementations
- * create a generic filtering method that can be called from any of the filter methods.
- */
-public interface Filter {
-
- /**
- * The result that can returned from a filter method call.
- */
- public enum Result {
- /**
- * The event will be processed without further filtering based on the log Level.
- */
- ACCEPT,
- /**
- * No decision could be made, further filtering should occur.
- */
- NEUTRAL,
- /**
- * The event should not be processed.
- */
- DENY
- }
-
- /**
- * Return the result that should be returned when the filter does not match the event.
- * @return the Result that should be returned when the filter does not match the event.
- */
- Result getOnMismatch();
- /**
- * Return the result that should be returned when the filter matches the event.
- * @return the Result that should be returned when the filter matches the event.
- */
- Result getOnMatch();
-
- /**
- * Filter an event.
- * @param logger The Logger.
- * @param level The event logging Level.
- * @param marker The Marker for the event or null.
- * @param msg String text to filter on.
- * @param params An array of parameters or null.
- * @return the Result.
- */
- Result filter(Logger logger, Level level, Marker marker, String msg, Object... params);
-
- /**
- * Filter an event.
- * @param logger The Logger.
- * @param level The event logging Level.
- * @param marker The Marker for the event or null.
- * @param msg Any Object.
- * @param t A Throwable or null.
- * @return the Result.
- */
- Result filter(Logger logger, Level level, Marker marker, Object msg, Throwable t);
-
- /**
- * Filter an event.
- * @param logger The Logger.
- * @param level The event logging Level.
- * @param marker The Marker for the event or null.
- * @param msg The Message
- * @param t A Throwable or null.
- * @return the Result.
- */
- Result filter(Logger logger, Level level, Marker marker, Message msg, Throwable t);
-
- /**
- * Filter an event.
- * @param event The Event to filter on.
- * @return the Result.
- */
- Result filter(LogEvent event);
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Layout.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Layout.java
deleted file mode 100644
index 5421fdc..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Layout.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import java.io.Serializable;
-
-/**
- * @doubt There is still a need for a character-based layout for character based event sinks (databases, etc).
- * Would introduce an EventEncoder, EventRenderer or something similar for the logging event to byte encoding.
- * (RG) A layout can be configured with a Charset and then Strings can be converted to byte arrays. OTOH, it isn't
- * possible to write byte arrays as character streams.
- * @param <T> The Object type that will be returned on the formatAs call.
- */
-public interface Layout<T extends Serializable> {
- /**
- * Formats the event suitable for display.
- * @param event The Logging Event.
- * @return The formatted event.
- * @doubt Likely better to write to a OutputStream instead of return a byte[]. (RG) That limits how the
- * Appender can use the Layout. For example, it might concatenate information in front or behind the
- * data and then write it all to the OutputStream in one call.
- */
- byte[] format(LogEvent event);
-
- /**
- * Formats the event as an Object that can be serialized.
- * @param event The Logging Event.
- * @return The formatted event.
- */
- T formatAs(LogEvent event);
-
- /**
- * Returns the header for the layout format.
- * @return The header.
- * @doubt the concept of header and footer is not universal, should not be on the base interface.
- * (RG) I agree with this.
- */
- byte[] getHeader();
-
- /**
- * Returns the format for the layout format.
- * @return The footer.
- * @doubt the concept of header and footer is not universal, should not be on the base interface.
- * (RG) I agree with this.
- */
- byte[] getFooter();
-
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Lifecycle.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Lifecycle.java
deleted file mode 100644
index 65fe131..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Lifecycle.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core;
-
-/**
- *
- */
-public interface Lifecycle {
- void start();
-
- void stop();
-
- boolean isStarted();
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
deleted file mode 100644
index 22bf3b7..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LogEvent.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-
-package org.apache.logging.log4j.core;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.message.Message;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Stack;
-
-/**
- *
- */
-public interface LogEvent extends Serializable {
-
- /**
- * Get level.
- * @return level.
- */
- Level getLevel();
-
- /**
- * Get logger name.
- * @return logger name, may be null.
- */
- String getLoggerName();
-
- /**
- * Get source of logging request.
- * @return source of logging request, may be null.
- */
- StackTraceElement getSource();
-
- /**
- * Get the message associated with the event.
- *
- * @return message.
- */
- Message getMessage();
-
- /**
- * Get the Marker associated with the event.
- * @return Marker
- */
- Marker getMarker();
-
- /**
- * Get thread name.
- * @return thread name, may be null.
- * @doubt guess this could go into a thread context object too.
- * (RG) Why?
- */
- String getThreadName();
-
-
- /**
- * Get event time in milliseconds since 1970.
- * @return milliseconds since 1970.
- */
- long getMillis();
-
-
- /**
- * Get throwable associated with logging request.
- * @return throwable, may be null.
- */
- Throwable getThrown();
-
-
- /**
- * Get the MDC data.
- *
- * @return A copy of the Mapped Diagnostic Context or null.
- * @doubt as mentioned elsewhere, think MDC and NDC should be combined into a thread context object.
- * (RG) Still to do.
- */
- Map<String, String> getContextMap();
-
- /**
- * Get the NDC data.
- *
- * @return A copy of the Nested Diagnostic Context of null;
- * @doubt as mentioned elsewhere, think MDC and NDC should be combined into a thread context object.
- * (RG) Still to do.
- */
- Stack<String> getContextStack();
-
- /**
- * Returns the fully qualified class name of the caller of the logging api.
- * @return The fully qualified class name of the caller.
- */
- String getFQCN();
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java
deleted file mode 100644
index e13066c..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/Logger.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.Marker;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.LoggerConfig;
-import org.apache.logging.log4j.core.filter.CompositeFilter;
-import org.apache.logging.log4j.message.Message;
-import org.apache.logging.log4j.message.SimpleMessage;
-import org.apache.logging.log4j.spi.AbstractLogger;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @doubt All the isEnabled methods could be pushed into a filter interface. Not sure of the utility of having
- * isEnabled be able to examine the message pattern and parameters. (RG) Moving the isEnabled methods out of
- * Logger noticeably impacts performance. The message pattern and parameters are required so that they can be
- * used in global filters.
- */
-public class Logger extends AbstractLogger {
-
- /**
- * config should be consistent across threads.
- */
- protected volatile PrivateConfig config;
-
- private final String name;
-
- private final LoggerContext context;
-
- /**
- * The constructor.
- * @param context The LoggerContext this Logger is associated with.
- * @param name The name of the Logger.
- */
- protected Logger(LoggerContext context, String name) {
- this.context = context;
- this.name = name;
- config = new PrivateConfig(context.getConfiguration(), this);
- }
-
- /**
- * Returns the name of the Logger.
- * @return the name of the Logger.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Return the parent of this Logger. If it doesn't already exist return a temporary Logger.
- * @return The parent Logger.
- */
- public Logger getParent() {
- LoggerConfig lc = config.loggerConfig.getParent();
- if (lc == null) {
- return null;
- }
- if (context.hasLogger(lc.getName())) {
- return context.getLogger(name);
- }
- return new Logger(context, name);
- }
-
- /**
- * Return the LoggerContext this Logger is associated with.
- * @return the LoggerContext.
- */
- public LoggerContext getContext() {
- return context;
- }
-
- /**
- * This method is not exposed through the public API and is provided primarily for unit testing.
- * @param level The Level to use on this Logger.
- */
- public synchronized void setLevel(Level level) {
- if (level != null) {
- config = new PrivateConfig(config, level);
- }
- }
-
- /**
- * Return the Level associated with the Logger.
- * @return the Level associate with the Logger.
- */
- public Level getLevel() {
- return config.level;
- }
-
- @Override
- public void log(Marker marker, String fqcn, Level level, Message data, Throwable t) {
- if (data == null) {
- data = new SimpleMessage("");
- }
- config.loggerConfig.log(name, marker, fqcn, level, data, t);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg) {
- return config.filter(level, marker, msg);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg, Throwable t) {
- return config.filter(level, marker, msg, t);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg, Object p1) {
- return config.filter(level, marker, msg, p1);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2) {
- return config.filter(level, marker, msg, p1, p2);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2, Object p3) {
- return config.filter(level, marker, msg, p1, p2, p3);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, String msg, Object p1, Object p2, Object p3,
- Object... params) {
- return config.filter(level, marker, msg, p1, p2, p3, params);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, Object msg, Throwable t) {
- return config.filter(level, marker, msg, t);
- }
-
- @Override
- public boolean isEnabled(Level level, Marker marker, Message msg, Throwable t) {
- return config.filter(level, marker, msg, t);
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @param appender The Appender to add to the Logger.
- */
- public void addAppender(Appender appender) {
- config.config.addLoggerAppender(this, appender);
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @param appender The Appender to remove from the Logger.
- */
- public void removeAppender(Appender appender) {
- config.loggerConfig.removeAppender(appender.getName());
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @return A Map containing the Appender's name as the key and the Appender as the value.
- */
- public Map<String, Appender> getAppenders() {
- return config.loggerConfig.getAppenders();
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @return An Iterator over all the Filters associated with the Logger.
- */
- public Iterator<Filter> getFilters() {
- Filter filter = config.loggerConfig.getFilter();
- if (filter == null) {
- return new ArrayList<Filter>().iterator();
- } else if (filter instanceof CompositeFilter) {
- return ((CompositeFilter) filter).iterator();
- } else {
- List<Filter> filters = new ArrayList<Filter>();
- filters.add(filter);
- return filters.iterator();
- }
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @return The number of Filters associated with the Logger.
- */
- public int filterCount() {
- Filter filter = config.loggerConfig.getFilter();
- if (filter == null) {
- return 0;
- } else if (filter instanceof CompositeFilter) {
- return ((CompositeFilter) filter).size();
- }
- return 1;
- }
-
- /**
- * This method is not exposed through the public API and is used primarily for unit testing.
- * @param filter The Filter to add.
- */
- public void addFilter(Filter filter) {
- config.config.addLoggerFilter(this, filter);
- }
-
- /**
- * This method is not exposed through the public API and is present only to support the Log4j 1.2
- * compatibility bridge.
- * @return true if the associated LoggerConfig is additive, false otherwise.
- */
- public boolean isAdditive() {
- return config.loggerConfig.isAdditive();
- }
-
- /**
- * This method is not exposed through the public API and is present only to support the Log4j 1.2
- * compatibility bridge.
- * @param additive Boolean value to indicate whether the Logger is additive or not.
- */
- public void setAdditive(boolean additive) {
- config.config.setLoggerAdditive(this, additive);
- }
-
- /**
- * Associates the Logger with a new Configuration. This method is not exposed through the
- * public API.
- *
- * There are two ways that could be used to guarantee all threads are aware of changes to
- * config. 1. synchronize this method. Accessors don't need to be synchronized as Java will
- * treat all variables within a synchronized block as volatile. 2. Declare the variable
- * volatile. Option 2 is used here as the performance cost is very low and it does a better
- * job at documenting how it is used.
- *
- * @param config The new Configuration.
- */
- void updateConfiguration(Configuration config) {
- this.config = new PrivateConfig(config, this);
- }
-
- /**
- * The binding between a Logger and its configuration.
- */
- protected class PrivateConfig {
- private final LoggerConfig loggerConfig;
- private final Configuration config;
- private final Level level;
- private final int intLevel;
- private final Logger logger;
-
- public PrivateConfig(Configuration config, Logger logger) {
- this.config = config;
- this.loggerConfig = config.getLoggerConfig(name);
- this.level = this.loggerConfig.getLevel();
- this.intLevel = this.level.intLevel();
- this.logger = logger;
- }
-
- public PrivateConfig(PrivateConfig pc, Level level) {
- this.config = pc.config;
- this.loggerConfig = pc.loggerConfig;
- this.level = level;
- this.intLevel = this.level.intLevel();
- this.logger = pc.logger;
- }
-
- public PrivateConfig(PrivateConfig pc, LoggerConfig lc) {
- this.config = pc.config;
- this.loggerConfig = lc;
- this.level = lc.getLevel();
- this.intLevel = this.level.intLevel();
- this.logger = pc.logger;
- }
-
- protected void logEvent(LogEvent event) {
- loggerConfig.log(event);
- }
-
- boolean filter(Level level, Marker marker, String msg) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, String msg, Throwable t) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, t);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, String msg, Object p1) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, p1);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, String msg, Object p1, Object p2) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, p1, p2);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, String msg, Object p1, Object p2, Object p3) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, p1, p2, p3);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, String msg, Object p1, Object p2, Object p3,
- Object... params) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, p1, p2, p3, params);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, Object msg, Throwable t) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, t);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
-
- boolean filter(Level level, Marker marker, Message msg, Throwable t) {
- Filter filter = config.getFilter();
- if (filter != null) {
- Filter.Result r = filter.filter(logger, level, marker, msg, t);
- if (r != Filter.Result.NEUTRAL) {
- return r == Filter.Result.ACCEPT;
- }
- }
-
- return intLevel >= level.intLevel();
- }
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
deleted file mode 100644
index 4b55448..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core;
-
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.ConfigurationFactory;
-import org.apache.logging.log4j.core.config.ConfigurationListener;
-import org.apache.logging.log4j.core.config.DefaultConfiguration;
-import org.apache.logging.log4j.core.config.NullConfiguration;
-import org.apache.logging.log4j.status.StatusLogger;
-
-import java.io.File;
-import java.net.URI;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * The LoggerContext is the anchor for the logging system. It maintains a list of all the loggers requested by
- * applications and a reference to the Configuration. The Configuration will contain the configured loggers, appenders,
- * filters, etc and will be atomically updated whenever a reconfigure occurs.
- */
-public class LoggerContext implements org.apache.logging.log4j.spi.LoggerContext, ConfigurationListener, Lifecycle {
-
- private static StatusLogger logger = StatusLogger.getLogger();
-
- private final ConcurrentMap<String, Logger> loggers = new ConcurrentHashMap<String, Logger>();
-
- /**
- * The Configuration is volatile to guarantee that initialization of the Configuration has completed before
- * the reference is updated.
- */
- private volatile Configuration config = new DefaultConfiguration();
-
- private Object externalContext = null;
-
- private final String contextName;
-
- private final URI configLocation;
-
- private boolean isStarted;
-
- /**
- * Constructor taking only a name.
- * @param name The context name.
- */
- public LoggerContext(String name) {
- this(name, null, (URI) null);
- }
-
- /**
- * Constructor taking a name and a reference to an external context.
- * @param name The context name.
- * @param externalContext The external context.
- */
- public LoggerContext(String name, Object externalContext) {
- this(name, externalContext, (URI) null);
- }
-
- /**
- * Constructor taking a name, external context and a configuration URI.
- * @param name The context name.
- * @param externalContext The external context.
- * @param configLocn The location of the configuration as a URI.
- */
- public LoggerContext(String name, Object externalContext, URI configLocn) {
- contextName = name;
- this.externalContext = externalContext;
- this.configLocation = configLocn;
- }
-
- /**
- * Constructor taking a name external context and a configuration location String. The location
- * must be resolvable to a File.
- * @param name The configuration location.
- * @param externalContext The external context.
- * @param configLocn The configuration location.
- */
- public LoggerContext(String name, Object externalContext, String configLocn) {
- contextName = name;
- this.externalContext = externalContext;
- if (configLocn != null) {
- URI uri;
- try {
- uri = new File(configLocn).toURI();
- } catch (Exception ex) {
- uri = null;
- }
- configLocation = uri;
- } else {
- configLocation = null;
- }
- }
-
- public void start() {
- reconfigure();
- isStarted = true;
- }
-
- public synchronized void stop() {
- isStarted = false;
- updateLoggers(new NullConfiguration());
- config.stop();
- externalContext = null;
- }
-
- public boolean isStarted() {
- return isStarted;
- }
-
- /**
- * Set the external context.
- * @param context The external context.
- */
- public void setExternalContext(Object context) {
- this.externalContext = context;
- }
-
- /**
- * Return the external context.
- * @return The external context.
- */
- public Object getExternalContext() {
- return this.externalContext;
- }
-
- /**
- * Obtain a Logger from the Context.
- * @param name The name of the Logger to return.
- * @return The Logger.
- */
- public Logger getLogger(String name) {
-
- Logger logger = loggers.get(name);
- if (logger != null) {
- return logger;
- }
-
- logger = (Logger) newInstance(this, name);
- Logger prev = loggers.putIfAbsent(name, logger);
- return prev == null ? logger : prev;
- }
-
- /**
- * Determine if the specified Logger exists.
- * @param name The Logger name to search for.
- * @return True if the Logger exists, false otherwise.
- */
- public boolean hasLogger(String name) {
- return loggers.containsKey(name);
- }
-
- /**
- * Return the current Configuration. The Configuration will be replaced when a reconfigure occurs.
- * @return The Configuration.
- */
- public Configuration getConfiguration() {
- return config;
- }
-
- /**
- * Add a Filter to the Configuration. Filters that are added through the API will be lost
- * when a reconfigure occurs.
- * @param filter The Filter to add.
- */
- public void addFilter(Filter filter) {
- config.addFilter(filter);
- }
-
- /**
- * Removes a Filter from the current Configuration.
- * @param filter The Filter to remove.
- */
- public void removeFiler(Filter filter) {
- config.removeFilter(filter);
- }
-
- /**
- * Set the Configuration to be used.
- * @param config The new Configuration.
- * @return The previous Configuration.
- */
- public synchronized Configuration setConfiguration(Configuration config) {
- if (config == null) {
- throw new NullPointerException("No Configuration was provided");
- }
- Configuration prev = this.config;
- config.addListener(this);
- config.start();
- this.config = config;
- updateLoggers();
- if (prev != null) {
- prev.removeListener(this);
- prev.stop();
- }
- return prev;
- }
-
- /**
- * Reconfigure the context.
- */
- public synchronized void reconfigure() {
- logger.debug("Reconfiguration started for context " + contextName);
- Configuration instance = ConfigurationFactory.getInstance().getConfiguration(contextName, configLocation);
- setConfiguration(instance);
- /*instance.start();
- Configuration old = setConfiguration(instance);
- updateLoggers();
- if (old != null) {
- old.stop();
- } */
- logger.debug("Reconfiguration completed");
- }
-
- /**
- * Cause all Loggers to be updated against the current Configuration.
- */
- public void updateLoggers() {
- updateLoggers(this.config);
- }
-
- /**
- * Cause all Logger to be updated against the specified Configuration.
- * @param config The Configuration.
- */
- public void updateLoggers(Configuration config) {
- for (Logger logger : loggers.values()) {
- logger.updateConfiguration(config);
- }
- }
-
- /**
- * Cause a reconfiguration to take place when the underlying configuration file changes.
- */
- public void onChange() {
- reconfigure();
- }
-
-
- private Logger newInstance(LoggerContext ctx, String name) {
- return new Logger(ctx, name);
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java
deleted file mode 100644
index 71bcacf..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AbstractManager.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.status.StatusLogger;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-/**
- * Base class used to register managers.
- */
-public abstract class AbstractManager {
-
- /**
- * Allow subclasses access to the status logger without creating another instance.
- */
- protected static final Logger LOGGER = StatusLogger.getLogger();
-
- // Need to lock that map instead of using a ConcurrentMap due to stop removing the
- // manager from the map and closing the stream, requiring the whole stop method to be locked.
- private static Map<String, AbstractManager> map = new HashMap<String, AbstractManager>();
-
- private static Lock lock = new ReentrantLock();
-
- private String name;
-
- private int count;
-
- protected AbstractManager(String name) {
- this.name = name;
- }
-
-
- /**
- * Retrieves a Manager if it has been previously created or creates a new Manager.
- * @param name The name of the Manager to retrieve.
- * @param factory The Factory to use to create the Manager.
- * @param data An Object that should be passed to the factory when creating the Manager.
- * @param <T> The Type of the Manager to be created.
- * @return A Manager with the specified name and type.
- */
- public static <T extends AbstractManager> T getManager(String name, ManagerFactory<T, Object> factory,
- Object data) {
- lock.lock();
- try {
- T manager = (T) map.get(name);
- if (manager == null) {
- manager = factory.createManager(name, data);
- if (manager == null) {
- throw new IllegalStateException("Unable to create a manager");
- }
- map.put(name, manager);
- }
- manager.count++;
- return manager;
- } finally {
- lock.unlock();
- }
- }
-
- /**
- * Determines if a Manager with the specified name exists.
- * @param name The name of the Manager.
- * @return True if the Manager exists, false otherwise.
- */
- public static boolean hasManager(String name) {
- lock.lock();
- try {
- return map.containsKey(name);
- } finally {
- lock.unlock();
- }
- }
-
- /**
- * May be overriden by Managers to perform processing while the Manager is being released and the
- * lock is held.
- */
- protected void releaseSub() {
- }
-
- protected int getCount() {
- return count;
- }
-
- /**
- * Called to signify that this Manager is no longer required by an Appender.
- */
- public void release() {
- lock.lock();
- try {
- --count;
- if (count <= 0) {
- map.remove(name);
- releaseSub();
- }
- } finally {
- lock.unlock();
- }
- }
-
- /**
- * Return the name of the Manager.
- * @return The name of the Manager.
- */
- public String getName() {
- return name;
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.java
deleted file mode 100644
index 1315517..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderBase.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.core.Appender;
-import org.apache.logging.log4j.core.ErrorHandler;
-import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Lifecycle;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.filter.Filterable;
-import org.apache.logging.log4j.status.StatusLogger;
-import org.apache.logging.log4j.Logger;
-
-/**
- * Base class for Appenders. Although Appenders do not have to extend this class, doing so
- * will simplify their implementation.
- */
-public abstract class AppenderBase extends Filterable implements Appender, Lifecycle {
- /**
- * Allow subclasses access to the status logger without creating another instance.
- */
- protected static final Logger LOGGER = StatusLogger.getLogger();
-
- /**
- * Appenders set this by calling super.start().
- */
- private boolean started = false;
-
- private Layout layout = null;
-
- private final String name;
-
- private final boolean handleException;
-
- private ErrorHandler handler = new DefaultErrorHandler(this);
-
- /**
- * Constructor that defaults to suppressing exceptions.
- * @param name The Appender name.
- * @param filter The Filter to associate with the Appender.
- * @param layout The layout to use to format the event.
- */
- protected AppenderBase(String name, Filter filter, Layout layout) {
- this(name, filter, layout, true);
- }
-
- /**
- * Constructor.
- * @param name The Appender name.
- * @param filter The Filter to associate with the Appender.
- * @param layout The layout to use to format the event.
- * @param handleException If true, exceptions will be logged and suppressed. If false errors will be
- * logged and then passed to the application.
- */
- protected AppenderBase(String name, Filter filter, Layout layout, boolean handleException) {
- super(filter);
- this.name = name;
- this.layout = layout;
- this.handleException = handleException;
- }
-
- /**
- * Return the ErrorHandler, if any.
- * @return The ErrorHandler.
- */
- public ErrorHandler getHandler() {
- return handler;
- }
-
- /**
- * The handler must be set before the appender is started.
- * @param handler The ErrorHandler to use.
- */
- public void setHandler(ErrorHandler handler) {
- if (handler == null) {
- LOGGER.error("The handler cannot be set to null");
- }
- if (isStarted()) {
- LOGGER.error("The handler cannot be changed once the appender is started");
- return;
- }
- this.handler = handler;
- }
-
- /**
- * Close the stream associated with the Appender.
- */
- public void close() {
-
- }
-
- /**
- * Returns the name of the Appender.
- * @return The name of the Appender.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns the Layout for the appender.
- * @return The Layout used to format the event.
- */
- public Layout getLayout() {
- return layout;
- }
-
- /**
- * Some appenders need to propogate exceptions back to the application. When suppressException is false the
- * AppenderControl will allow the exception to percolate.
- * @return true if exceptions will be supressed, false otherwise.
- */
- public boolean isExceptionSuppressed() {
- return handleException;
- }
-
- /**
- * Start the Appender.
- */
- public void start() {
- startFilter();
- this.started = true;
- }
-
- /**
- * Stop the Appender.
- */
- public void stop() {
- this.started = false;
- stopFilter();
- }
-
- /**
- * Returns true if the Appender is started, false otherwise.
- * @return true if the Appender is started, false otherwise.
- */
- public boolean isStarted() {
- return started;
- }
-
- @Override
- public String toString() {
- return name;
- }
-
- /**
- * Handle an error with a message.
- * @param msg The message.
- */
- public void error(String msg) {
- handler.error(msg);
- }
-
- /**
- * Handle an error with a message and an exception.
- * @param msg The message.
- * @param t The Throwable.
- */
- public void error(String msg, Throwable t) {
- handler.error(msg, t);
- }
-
- /**
- * Handle an error with a message, and exception and a logging event.
- * @param msg The message.
- * @param event The LogEvent.
- * @param t The Throwable.
- */
- public void error(String msg, LogEvent event, Throwable t) {
- handler.error(msg, event, t);
- }
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java
deleted file mode 100644
index a5eea16..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/AppenderRuntimeException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-/**
- * @doubt unchecked exception again (RG) Why is that a problem? A runtime exception
- * is appropriate in the case where the Appender encounters a checked exception and
- * needs to percolate the exception to the application.
- */
-public class AppenderRuntimeException extends RuntimeException {
-
- public AppenderRuntimeException(String msg) {
- super(msg);
- }
-
- public AppenderRuntimeException(String msg, Throwable ex) {
- super(msg, ex);
- }
-
- public AppenderRuntimeException(Throwable ex) {
- super(ex);
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java
deleted file mode 100644
index ddf9ab7..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/CompressionType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-/**
- * An enumeration of the valid compression types.
- */
-public enum CompressionType {
- /** GZIP. */
- GZIP,
- /** No compression. */
- NONE,
- /** ZIP. */
- ZIP
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
deleted file mode 100644
index e9b82b6..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/ConsoleAppender.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttr;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.layout.PatternLayout;
-
-import java.io.OutputStream;
-
-/**
- * ConsoleAppender appends log events to <code>System.out</code> or
- * <code>System.err</code> using a layout specified by the user. The
- * default target is <code>System.out</code>.
- * @doubt accessing System.out or .err as a byte stream instead of a writer
- * bypasses the JVM's knowledge of the proper encoding. (RG) Encoding
- * is handled within the Layout. Typically, a Layout will generate a String
- * and then call getBytes which may use a configured encoding or the system
- * default. OTOH, a Writer cannot print byte streams.
- */
-@Plugin(name = "Console", type = "Core", elementType = "appender", printObject = true)
-public final class ConsoleAppender extends OutputStreamAppender {
-
- private static ManagerFactory factory = new ConsoleManagerFactory();
-
- /**
- * Enumeration of console destinations.
- */
- public enum Target {
- /** Standard output. */
- SYSTEM_OUT,
- /** Standard error output. */
- SYSTEM_ERR
- }
-
- private ConsoleAppender(String name, Layout layout, Filter filter, OutputStreamManager manager,
- boolean handleExceptions) {
- super(name, layout, filter, handleExceptions, true, manager);
- }
-
- /**
- * Create a Console Appender.
- * @param layout The layout to use (required).
- * @param filter The Filter or null.
- * @param t The target ("SYSTEM_OUT" or "SYSTEM_ERR"). The default is "SYSTEM_OUT".
- * @param name The name of the Appender (required).
- * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
- * The default is "true".
- * @return The ConsoleAppender.
- */
- @PluginFactory
- public static ConsoleAppender createAppender(@PluginElement("layout") Layout layout,
- @PluginElement("filters") Filter filter,
- @PluginAttr("target") String t,
- @PluginAttr("name") String name,
- @PluginAttr("suppressExceptions") String suppress) {
- if (name == null) {
- LOGGER.error("No name provided for ConsoleAppender");
- return null;
- }
- if (layout == null) {
- layout = PatternLayout.createLayout(null, null, null, null);
- }
- boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
- Target target = t == null ? Target.SYSTEM_OUT : Target.valueOf(t);
- return new ConsoleAppender(name, layout, filter, getManager(target), handleExceptions);
- }
-
- private static OutputStreamManager getManager(Target target) {
- String type = target.name();
- OutputStream os = target == Target.SYSTEM_OUT ? System.out : System.err;
- OutputStreamManager manager = OutputStreamManager.getManager(target.name(), factory,
- new FactoryData(os, type));
- return manager;
- }
-
- /**
- * Data to pass to factory method.
- */
- private static class FactoryData {
- private OutputStream os;
- private String type;
-
- /**
- * Constructor.
- * @param os The OutputStream.
- * @param type The name of the target.
- */
- public FactoryData(OutputStream os, String type) {
- this.os = os;
- this.type = type;
- }
- }
-
- /**
- * Factory to create the Appender.
- */
- private static class ConsoleManagerFactory implements ManagerFactory<OutputStreamManager, FactoryData> {
-
- /**
- * Create an OutputStreamManager.
- * @param name The name of the entity to manage.
- * @param data The data required to create the entity.
- * @return The OutputStreamManager
- */
- public OutputStreamManager createManager(String name, FactoryData data) {
- return new OutputStreamManager(data.os, data.type);
- }
- }
-
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java
deleted file mode 100644
index 9831dcd..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/DefaultErrorHandler.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.Appender;
-import org.apache.logging.log4j.core.ErrorHandler;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.status.StatusLogger;
-
-/**
- *
- */
-public class DefaultErrorHandler implements ErrorHandler {
-
- private static final Logger LOGGER = StatusLogger.getLogger();
-
- private static final int MAX_EXCEPTIONS = 3;
-
- private static final int EXCEPTION_INTERVAL = 300000;
-
- private int exceptionCount = 0;
-
- private long lastException;
-
- private Appender appender;
-
- public DefaultErrorHandler(Appender appender) {
- this.appender = appender;
- }
-
-
- /**
- * Handle an error with a message.
- * @param msg The message.
- */
- public void error(String msg) {
- long current = System.currentTimeMillis();
- if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
- LOGGER.error(msg);
- }
- lastException = current;
- }
-
- /**
- * Handle an error with a message and an exception.
- * @param msg The message.
- * @param t The Throwable.
- */
- public void error(String msg, Throwable t) {
- long current = System.currentTimeMillis();
- if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
- LOGGER.error(msg, t);
- }
- lastException = current;
- if (!appender.isExceptionSuppressed() && t != null) {
- throw new AppenderRuntimeException(msg, t);
- }
- }
-
- /**
- * Handle an error with a message, and exception and a logging event.
- * @param msg The message.
- * @param event The LogEvent.
- * @param t The Throwable.
- */
- public void error(String msg, LogEvent event, Throwable t) {
- long current = System.currentTimeMillis();
- if (lastException + EXCEPTION_INTERVAL < current || exceptionCount++ < MAX_EXCEPTIONS) {
- LOGGER.error(msg, t);
- }
- lastException = current;
- if (!appender.isExceptionSuppressed() && t != null) {
- throw new AppenderRuntimeException(msg, t);
- }
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
deleted file mode 100644
index 276d277..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoverAppender.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.LoggingException;
-import org.apache.logging.log4j.core.Appender;
-import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.LogEvent;
-import org.apache.logging.log4j.core.config.AppenderControl;
-import org.apache.logging.log4j.core.config.Configuration;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttr;
-import org.apache.logging.log4j.core.config.plugins.PluginConfiguration;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * The FailoverAppender will capture exceptions in an Appender and then route the event
- * to a different appender. Hopefully it is obvious that the Appenders must be configured
- * to not suppress exceptions for the FailoverAppender to work.
- */
-@Plugin(name = "Failover", type = "Core", elementType = "appender", printObject = true)
-public final class FailoverAppender extends AppenderBase {
-
- private final String primaryRef;
-
- private final String[] failovers;
-
- private final Configuration config;
-
- private AppenderControl primary;
-
- private List<AppenderControl> failoverAppenders = new ArrayList<AppenderControl>();
-
- private FailoverAppender(String name, Filter filter, String primary, String[] failovers,
- Configuration config, boolean handleExceptions) {
- super(name, filter, null, handleExceptions);
- this.primaryRef = primary;
- this.failovers = failovers;
- this.config = config;
- }
-
-
- @Override
- public void start() {
- Map<String, Appender> map = config.getAppenders();
- int errors = 0;
- if (map.containsKey(primaryRef)) {
- primary = new AppenderControl(map.get(primaryRef));
- } else {
- LOGGER.error("Unable to locate primary Appender " + primaryRef);
- ++errors;
- }
- for (String name : failovers) {
- if (map.containsKey(name)) {
- failoverAppenders.add(new AppenderControl(map.get(name)));
- } else {
- LOGGER.error("Failover appender " + name + " is not configured");
- }
- }
- if (failoverAppenders.size() == 0) {
- LOGGER.error("No failover appenders are available");
- ++errors;
- }
- if (errors == 0) {
- super.start();
- }
- }
-
- /**
- * Handle the Log event.
- * @param event The LogEvent.
- */
- public void append(LogEvent event) {
- RuntimeException re = null;
- if (!isStarted()) {
- error("FailoverAppender " + getName() + " did not start successfully");
- return;
- }
- try {
- primary.callAppender(event);
- } catch (Exception ex) {
- re = new LoggingException(ex);
- boolean written = false;
- for (AppenderControl control : failoverAppenders) {
- try {
- control.callAppender(event);
- written = true;
- break;
- } catch (Exception fex) {
- // Try the next failover.
- }
- }
- if (!written && !isExceptionSuppressed()) {
- throw re;
- }
- }
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(getName());
- sb.append(" primary=").append(primary).append(", failover={");
- boolean first = true;
- for (String str : failovers) {
- if (!first) {
- sb.append(", ");
- }
- sb.append(str);
- first = false;
- }
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Create a Failover Appender.
- * @param name The name of the Appender (required).
- * @param primary The name of the primary Appender (required).
- * @param failovers The name of one or more Appenders to fail over to (at least one is required).
- * @param config The current Configuration (passed by the Configuration when the appender is created).
- * @param filter A Filter (optional).
- * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
- * The default is "true".
- * @return The FailoverAppender that was created.
- */
- @PluginFactory
- public static FailoverAppender createAppender(@PluginAttr("name") String name,
- @PluginAttr("primary") String primary,
- @PluginElement("failovers") String[] failovers,
- @PluginConfiguration Configuration config,
- @PluginElement("filters") Filter filter,
- @PluginAttr("suppressExceptions") String suppress) {
- if (name == null) {
- LOGGER.error("A name for the Appender must be specified");
- return null;
- }
- if (primary == null) {
- LOGGER.error("A primary Appender must be specified");
- return null;
- }
- if (failovers == null || failovers.length == 0) {
- LOGGER.error("At least one failover Appender must be specified");
- return null;
- }
-
- boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-
- return new FailoverAppender(name, filter, primary, failovers, config, handleExceptions);
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
deleted file mode 100644
index 487b571..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FailoversPlugin.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.Logger;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.status.StatusLogger;
-
-/**
- * The array of failover Appenders.
- */
-@Plugin(name = "failovers", type = "Core")
-public final class FailoversPlugin {
-
- private static Logger logger = StatusLogger.getLogger();
-
- /**
- * Prevent instantiation.
- */
- private FailoversPlugin() {
- }
-
- /**
- * Return the appender references.
- * @param refs The references to return.
- * @return The appender references.
- */
- @PluginFactory
- public static String[] createFailovers(@PluginElement("appender-ref") String[] refs) {
-
- if (refs == null) {
- logger.error("failovers must contain an appender-refernce");
- }
- return refs;
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
deleted file mode 100644
index 395cfd4..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileAppender.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import org.apache.logging.log4j.core.Filter;
-import org.apache.logging.log4j.core.Layout;
-import org.apache.logging.log4j.core.config.plugins.Plugin;
-import org.apache.logging.log4j.core.config.plugins.PluginAttr;
-import org.apache.logging.log4j.core.config.plugins.PluginElement;
-import org.apache.logging.log4j.core.config.plugins.PluginFactory;
-import org.apache.logging.log4j.core.layout.PatternLayout;
-
-/**
- * File Appender.
- */
-@Plugin(name = "File", type = "Core", elementType = "appender", printObject = true)
-public final class FileAppender extends OutputStreamAppender {
-
- private final String fileName;
-
- private FileAppender(String name, Layout layout, Filter filter, FileManager manager, String filename,
- boolean handleException, boolean immediateFlush) {
- super(name, layout, filter, handleException, immediateFlush, manager);
- this.fileName = filename;
- }
-
- /**
- * Return the file name this appender is associated with.
- * @return The File name.
- */
- public String getFileName() {
- return this.fileName;
- }
-
- /**
- * Create a File Appender.
- * @param fileName The name and path of the file.
- * @param append "True" if the file should be appended to, "false" if it should be overwritten.
- * The default is "true".
- * @param locking "True" if the file should be locked. The default is "false".
- * @param name The name of the Appender.
- * @param immediateFlush "true" if the contents should be flushed on every write, "false" otherwise. The default
- * is "true".
- * @param suppress "true" if exceptions should be hidden from the application, "false" otherwise.
- * The default is "true".
- * @param bufferedIO "true" if I/O should be buffered, "false" otherwise. The default is "true".
- * @param layout The layout to use to format the event. If no layout is provided the default PatternLayout
- * will be used.
- * @param filter The filter, if any, to use.
- * @return The FileAppender.
- */
- @PluginFactory
- public static FileAppender createAppender(@PluginAttr("fileName") String fileName,
- @PluginAttr("append") String append,
- @PluginAttr("locking") String locking,
- @PluginAttr("name") String name,
- @PluginAttr("immediateFlush") String immediateFlush,
- @PluginAttr("suppressExceptions") String suppress,
- @PluginAttr("bufferedIO") String bufferedIO,
- @PluginElement("layout") Layout layout,
- @PluginElement("filters") Filter filter) {
-
- boolean isAppend = append == null ? true : Boolean.valueOf(append);
- boolean isLocking = locking == null ? false : Boolean.valueOf(locking);
- boolean isBuffered = bufferedIO == null ? true : Boolean.valueOf(bufferedIO);
- if (isLocking && isBuffered) {
- if (bufferedIO != null) {
- LOGGER.warn("Locking and buffering are mutually exclusive. No buffereing will occur for " + fileName);
- }
- isBuffered = false;
- }
- boolean isFlush = immediateFlush == null ? true : Boolean.valueOf(immediateFlush);
- boolean handleExceptions = suppress == null ? true : Boolean.valueOf(suppress);
-
- if (name == null) {
- LOGGER.error("No name provided for FileAppender");
- return null;
- }
-
- if (fileName == null) {
- LOGGER.error("No filename provided for FileAppender with name " + name);
- return null;
- }
-
- FileManager manager = FileManager.getFileManager(fileName, isAppend, isLocking, isBuffered);
- if (manager == null) {
- return null;
- }
- if (layout == null) {
- layout = PatternLayout.createLayout(null, null, null, null);
- }
- return new FileAppender(name, layout, filter, manager, fileName, handleExceptions, isFlush);
- }
-}
diff --git a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java b/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java
deleted file mode 100644
index a514030..0000000
--- a/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/appender/FileManager.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache license, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the license for the specific language governing permissions and
- * limitations under the license.
- */
-package org.apache.logging.log4j.core.appender;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-
-
-/**
- * Class that handles actual File I/O for File Appenders.
- */
-public class FileManager extends OutputStreamManager {
-
- private static ManagerFactory factory = new FileManagerFactory();
-
- private boolean isAppend;
- private boolean isLocking;
-
- protected FileManager(String fileName, OutputStream os, boolean append, boolean locking) {
- super(os, fileName);
- this.isAppend = append;
- this.isLocking = locking;
- }
-
- /**
- * Return the FileManager.
- * @param fileName The name of the file to manage.
- * @param append true if the file should be appended to, false if it should be overwritten.
- * @param locking true if the file should be locked while writing, false otherwise.
- * @param bufferedIO true if the contents should be buffered as they are written.
- * @return A FileManager for the File.
- */
- public static FileManager getFileManager(String fileName, boolean append, boolean locking, boolean bufferedIO) {
-
- if (locking && bufferedIO) {
- locking = false;
- }
- return (FileManager) getManager(fileName, factory, new FactoryData(append, locking, bufferedIO));
- }
-
- protected synchronized void write(byte[] bytes, int offset, int length) {
-