You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by rg...@apache.org on 2010/05/13 08:31:09 UTC
svn commit: r943816 [3/9] - in
/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers: ./ log4j12-api/
log4j12-api/src/ log4j12-api/src/main/ log4j12-api/src/main/java/
log4j12-api/src/main/java/org/ log4j12-api/src/main/java/org/apache/
log4j12-api/sr...
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java Thu May 13 06:31:04 2010
@@ -0,0 +1,1018 @@
+/*
+ * 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.message.Message;
+import org.apache.logging.log4j.message.ObjectMessage;
+import org.apache.logging.log4j.message.ParameterizedMessage;
+import org.apache.logging.log4j.message.SimpleMessage;
+
+/**
+ *
+ */
+public abstract class AbstractLogger implements Logger {
+
+ protected String getFQCN() {
+ return AbstractLogger.class.getName();
+ }
+
+ /**
+ * Log entry to a method.
+ *
+ * @param params The parameters to the method.
+ */
+ public void entry(Object... params) {
+ if (isEnabled(Level.TRACE, Logger.ENTRY_MARKER, (Object)null, null)) {
+ log(Logger.ENTRY_MARKER, getFQCN(), Level.TRACE, entryMsg(params.length, params), null);
+ }
+ }
+
+ /**
+ * Log exit from a method.
+ */
+ public void exit() {
+ if (isEnabled(Level.TRACE, Logger.EXIT_MARKER, (Object)null, null)) {
+ log(Logger.EXIT_MARKER, getFQCN(), Level.TRACE, exitMsg(null), null);
+ }
+ }
+
+ /**
+ * Log exiting from a method with the result.
+ *
+ * @param result The result being returned from the method call.
+ */
+ public void exit(Object result) {
+ if (isEnabled(Level.TRACE, Logger.EXIT_MARKER, (Object)null, null)) {
+ log(Logger.EXIT_MARKER, getFQCN(), Level.TRACE, exitMsg(result), null);
+ }
+ }
+
+ /**
+ * Log an exception or error to be thrown.
+ *
+ * @param t The Throwable.
+ */
+ public void throwing(Throwable t) {
+ if (isEnabled(Level.ERROR, Logger.THROWING_MARKER, (Object)null, null)) {
+ log(Logger.THROWING_MARKER, getFQCN(), Level.ERROR, new SimpleMessage("throwing"), t);
+ }
+ }
+
+
+ /**
+ * Log an exception or error to be thrown.
+ *
+ * @param level The logging Level.
+ * @param t The Throwable.
+ */
+ public void throwing(Level level, Throwable t) {
+ if (isEnabled(level, Logger.THROWING_MARKER, (Object)null, null)) {
+ log(Logger.THROWING_MARKER, getFQCN(), level, new SimpleMessage("throwing"), t);
+ }
+ }
+
+ /**
+ * Log an exception or error that has been caught.
+ *
+ * @param t The Throwable.
+ */
+ public void catching(Throwable t) {
+ if (isEnabled(Level.DEBUG, Logger.THROWING_MARKER, (Object)null, null)) {
+ log(Logger.THROWING_MARKER, getFQCN(), 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, Logger.THROWING_MARKER, (Object)null, null)) {
+ log(Logger.THROWING_MARKER, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.TRACE, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.DEBUG, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.INFO, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), Level.DEBUG, new SimpleMessage(message), 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(Object message) {
+ if (isEnabled(Level.WARN, null, message, null)) {
+ log(null, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.WARN, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.ERROR, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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)) {
+ log(null, getFQCN(), Level.FATAL, new ParameterizedMessage(message, params), null);
+ }
+ }
+
+ /**
+ * 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.
+ *
+ * @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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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, getFQCN(), 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 + ")");
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContext.java Thu May 13 06:31:04 2010
@@ -0,0 +1,11 @@
+package org.apache.logging.log4j.spi;
+
+import org.apache.logging.log4j.Logger;
+
+/**
+ *
+ */
+public interface LoggerContext {
+
+ Logger getLogger(String name);
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/LICENSE
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/LICENSE?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/LICENSE (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/LICENSE Thu May 13 06:31:04 2010
@@ -0,0 +1,202 @@
+
+ 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.
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/NOTICE
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/NOTICE?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/NOTICE (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/resources/NOTICE Thu May 13 06:31:04 2010
@@ -0,0 +1,5 @@
+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
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/LoggerTest.java Thu May 13 06:31:04 2010
@@ -0,0 +1,87 @@
+/*
+ * 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.Test;
+
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ *
+ */
+public class LoggerTest {
+
+ Logger logger = LogManager.getLogger("LoggerTest");
+ @Test
+ public void basicFlow() {
+ logger.entry();
+ logger.exit();
+ }
+
+ @Test
+ public void throwing() {
+ logger.throwing(new IllegalArgumentException("Test Exception"));
+ }
+
+ @Test
+ public void catching() {
+ try {
+ throw new NullPointerException();
+ } catch (Exception e) {
+ logger.catching(e);
+ }
+ }
+
+ @Test
+ public void debug() {
+ logger.debug("Debug message");
+ }
+
+ @Test
+ public void debugObject() {
+ logger.debug(new Date());
+ }
+
+ @Test
+ public void debugWithParms() {
+ logger.debug("Hello, {}", "World");
+ }
+
+ @Test
+ public void mdc() {
+
+ MDC.put("TestYear", new Integer(2010));
+ logger.debug("Debug message");
+ MDC.clear();
+ logger.debug("Debug message");
+ }
+
+ @Test
+ public void structuredData() {
+ MDC.put("loginId", "JohnDoe");
+ MDC.put("ipAddress", "192.168.0.120");
+ MDC.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(Marker.getMarker("EVENT"), msg);
+ MDC.clear();
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLogger.java Thu May 13 06:31:04 2010
@@ -0,0 +1,105 @@
+/*
+ * 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.Map;
+
+/**
+ *
+ */
+public class SimpleLogger extends AbstractLogger {
+ @Override
+ protected String getFQCN() {
+ return SimpleLogger.class.getName();
+ }
+
+ @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, Object> mdc = MDC.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());
+ }
+ 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;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/java/org/apache/logging/log4j/SimpleLoggerContext.java Thu May 13 06:31:04 2010
@@ -0,0 +1,30 @@
+/*
+ * 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;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/test/resources/META-INF/log4j-provider.xml Thu May 13 06:31:04 2010
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+<properties>
+ <entry key="LoggerContextClass">org.apache.logging.log4j.SimpleLoggerContext</entry>
+ <entry key="Log4jAPIVersion">1.99.0</entry>
+</properties>
\ No newline at end of file
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/LICENSE
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/LICENSE?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/LICENSE (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/LICENSE Thu May 13 06:31:04 2010
@@ -0,0 +1,202 @@
+
+ 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.
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/NOTICE
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/NOTICE?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/NOTICE (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/NOTICE Thu May 13 06:31:04 2010
@@ -0,0 +1,5 @@
+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
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/build.xml
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/build.xml?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/build.xml (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/build.xml Thu May 13 06:31:04 2010
@@ -0,0 +1,123 @@
+<!--
+ 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>
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/PatternParser_mdc
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/PatternParser_mdc?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/PatternParser_mdc (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/PatternParser_mdc Thu May 13 06:31:04 2010
@@ -0,0 +1,12 @@
+starting mdc pattern test
+empty mdc, no key specified in pattern : {}
+empty mdc, key1 in pattern :
+empty mdc, key2 in pattern :
+empty mdc, key3 in pattern :
+empty mdc, key1, key2, and key3 in pattern : ,,
+filled mdc, no key specified in pattern : {key1=value1, key2=value2}
+filled mdc, key1 in pattern : value1
+filled mdc, key2 in pattern : value2
+filled mdc, key3 in pattern :
+filled mdc, key1, key2, and key3 in pattern : value1,value2,
+finished mdc pattern test
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/filtered
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/filtered?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/filtered (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/filtered Thu May 13 06:31:04 2010
@@ -0,0 +1,12 @@
+starting mdc pattern test
+empty mdc, no key specified in pattern : {}
+empty mdc, key1 in pattern :
+empty mdc, key2 in pattern :
+empty mdc, key3 in pattern :
+empty mdc, key1, key2, and key3 in pattern : ,,
+filled mdc, no key specified in pattern : {{key1,value1}{key2,value2}}
+filled mdc, key1 in pattern : value1
+filled mdc, key2 in pattern : value2
+filled mdc, key3 in pattern :
+filled mdc, key1, key2, and key3 in pattern : value1,value2,
+finished mdc pattern test
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/patternLayout.mdc.2
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/patternLayout.mdc.2?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/patternLayout.mdc.2 (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/output/patternLayout.mdc.2 Thu May 13 06:31:04 2010
@@ -0,0 +1,12 @@
+starting mdc pattern test
+empty mdc, no key specified in pattern : {}
+empty mdc, key1 in pattern :
+empty mdc, key2 in pattern :
+empty mdc, key3 in pattern :
+empty mdc, key1, key2, and key3 in pattern : ,,
+filled mdc, no key specified in pattern : {{key2,value2}{key1,value1}}
+filled mdc, key1 in pattern : value1
+filled mdc, key2 in pattern : value2
+filled mdc, key3 in pattern :
+filled mdc, key1, key2, and key3 in pattern : value1,value2,
+finished mdc pattern test
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org