Skip to content

Commit

Permalink
Revert "make log4j-over-slf4j run in jboss 4.2"
Browse files Browse the repository at this point in the history
This reverts commit 3749a85.
  • Loading branch information
ceki committed Oct 19, 2010
1 parent 3749a85 commit 9f10490
Show file tree
Hide file tree
Showing 58 changed files with 147 additions and 759 deletions.
4 changes: 2 additions & 2 deletions jcl-over-slf4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
<configuration>
<comparisonArtifacts>
<comparisonArtifact>
<groupId>commons-loxx</groupId>
<artifactId>commons-loxx</artifactId>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</comparisonArtifact>
</comparisonArtifacts>
Expand Down
22 changes: 11 additions & 11 deletions jcl-over-slf4j/src/main/java/org/apache/commons/logging/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
package org.apache.commons.logging;

/**
* <p>A simple loxx interface abstracting loxx APIs. In order to be
* <p>A simple logging interface abstracting logging APIs. In order to be
* instantiated successfully by {@link LogFactory}, classes that implement
* this interface must have a constructor that takes a single String
* parameter representing the "name" of this Log.</p>
*
* <p> The six loxx levels used by <code>Log</code> are (in order):
* <p> The six logging levels used by <code>Log</code> are (in order):
* <ol>
* <li>trace (the least serious)</li>
* <li>debug</li>
Expand All @@ -33,11 +33,11 @@
* <li>fatal (the most serious)</li>
* </ol>
* The mapping of these log levels to the concepts used by the underlying
* loxx system is implementation dependent.
* logging system is implementation dependent.
* The implementation should ensure, though, that this ordering behaves
* as expected.</p>
*
* <p>Performance is often a loxx concern.
* <p>Performance is often a logging concern.
* By examining the appropriate property,
* a component can avoid expensive operations (producing information
* to be logged).</p>
Expand All @@ -51,7 +51,7 @@
* </pre></code>
* </p>
*
* <p>Configuration of the underlying loxx system will generally be done
* <p>Configuration of the underlying logging system will generally be done
* external to the Logging APIs, through whatever mechanism is supported by
* that system.</p>
*
Expand All @@ -68,7 +68,7 @@ public interface Log {


/**
* <p> Is debug loxx currently enabled? </p>
* <p> Is debug logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand All @@ -78,7 +78,7 @@ public interface Log {


/**
* <p> Is error loxx currently enabled? </p>
* <p> Is error logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand All @@ -88,7 +88,7 @@ public interface Log {


/**
* <p> Is fatal loxx currently enabled? </p>
* <p> Is fatal logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand All @@ -98,7 +98,7 @@ public interface Log {


/**
* <p> Is info loxx currently enabled? </p>
* <p> Is info logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand All @@ -108,7 +108,7 @@ public interface Log {


/**
* <p> Is trace loxx currently enabled? </p>
* <p> Is trace logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand All @@ -118,7 +118,7 @@ public interface Log {


/**
* <p> Is warn loxx currently enabled? </p>
* <p> Is warn logging currently enabled? </p>
*
* <p> Call this method to prevent having to perform expensive operations
* (for example, <code>String</code> concatenation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class LogFactory {

/**
* The name (<code>use_tccl</code>) of the key in the config file used to
* specify whether loxx classes should be loaded via the thread context
* specify whether logging classes should be loaded via the thread context
* class loader (TCCL), or not. By default, the TCCL is used.
*
* <p>
Expand Down Expand Up @@ -94,9 +94,9 @@ public abstract class LogFactory {
"META-INF/services/org.apache.commons.logging.LogFactory";

/**
* The name (<code>org.apache.commons.loxx.diagnostics.dest</code>) of
* the property used to enable internal commons-loxx diagnostic output, in
* order to get information on what loxx implementations are being
* The name (<code>org.apache.commons.logging.diagnostics.dest</code>) of
* the property used to enable internal commons-logging diagnostic output, in
* order to get information on what logging implementations are being
* discovered, what classloaders they are loaded through, etc.
*
* <p>
Expand Down Expand Up @@ -182,7 +182,7 @@ protected LogFactory() {
* @param name
* Logical name of the <code>Log</code> instance to be
* returned (the meaning of this name is only known to the
* underlying loxx implementation that is being wrapped)
* underlying logging implementation that is being wrapped)
*
* @exception LogConfigurationException
* if a suitable <code>Log</code> instance cannot be
Expand Down Expand Up @@ -230,16 +230,16 @@ protected LogFactory() {
* implementation class to be loaded.
* </p>
* <ul>
* <li>The <code>org.apache.commons.loxx.LogFactory</code> system
* <li>The <code>org.apache.commons.logging.LogFactory</code> system
* property.</li>
* <li>The JDK 1.3 Service Discovery mechanism</li>
* <li>Use the properties file <code>commons-loxx.properties</code>
* <li>Use the properties file <code>commons-logging.properties</code>
* file, if found in the class path of this class. The configuration file is
* in standard <code>java.util.Properties</code> format and contains the
* fully qualified name of the implementation class with the key being the
* system property defined above.</li>
* <li>Fall back to a default implementation class (
* <code>org.apache.commons.loxx.impl.SLF4FLogFactory</code>).</li>
* <code>org.apache.commons.logging.impl.SLF4FLogFactory</code>).</li>
* </ul>
*
* <p>
Expand Down Expand Up @@ -279,7 +279,7 @@ public static Log getLog(Class clazz) throws LogConfigurationException {
* @param name
* Logical name of the <code>Log</code> instance to be
* returned (the meaning of this name is only known to the
* underlying loxx implementation that is being wrapped)
* underlying logging implementation that is being wrapped)
*
* @exception LogConfigurationException
* if a suitable <code>Log</code> instance cannot be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.slf4j.spi.LocationAwareLogger;

/**
* Implementation of {@link Log org.apache.commons.loxx.Log} interface which
* Implementation of {@link Log org.apache.commons.logging.Log} interface which
* delegates all processing to a wrapped {@link Logger org.slf4j.Logger}
* instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.slf4j.LoggerFactory;

/**
* Implementation of {@link Log org.apache.commons.loxx.Log} interface which
* Implementation of {@link Log org.apache.commons.logging.Log} interface which
* delegates all processing to a wrapped {@link Logger org.slf4j.Logger}
* instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public Log getInstance(Class clazz) throws LogConfigurationException {
*
* @param name
* Logical name of the <code>Log</code> instance to be returned
* (the meaning of this name is only known to the underlying loxx
* (the meaning of this name is only known to the underlying logging
* implementation that is being wrapped)
*
* @exception LogConfigurationException
Expand Down Expand Up @@ -177,7 +177,7 @@ public void release() {
// This method is never called by jcl-over-slf4j classes. However,
// in certain deployment scenarios, in particular if jcl-over-slf4j.jar
// is
// in the the web-app class loader and the official commons-loxx.jar is
// in the the web-app class loader and the official commons-logging.jar is
// deployed in some parent class loader (e.g. commons/lib), then it is
// possible
// for the parent class loader to mask the classes shipping in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
* to configure the behavior of this logger:
* </p>
* <ul>
* <li><code>org.apache.commons.loxx.simplelog.defaultlog</code> - Default
* loxx detail level for all instances of SimpleLog. Must be one of ("trace",
* <li><code>org.apache.commons.logging.simplelog.defaultlog</code> - Default
* logging detail level for all instances of SimpleLog. Must be one of ("trace",
* "debug", "info", "warn", "error", or "fatal"). If not specified, defaults to
* "info".</li>
* <li><code>org.apache.commons.loxx.simplelog.log.xxxxx</code> - Logging
* <li><code>org.apache.commons.logging.simplelog.log.xxxxx</code> - Logging
* detail level for a SimpleLog instance named "xxxxx". Must be one of ("trace",
* "debug", "info", "warn", "error", or "fatal"). If not specified, the default
* loxx detail level is used.</li>
* <li><code>org.apache.commons.loxx.simplelog.showlogname</code> - Set to
* logging detail level is used.</li>
* <li><code>org.apache.commons.logging.simplelog.showlogname</code> - Set to
* <code>true</code> if you want the Log instance name to be included in output
* messages. Defaults to <code>false</code>.</li>
* <li><code>org.apache.commons.loxx.simplelog.showShortLogname</code> - Set
* <li><code>org.apache.commons.logging.simplelog.showShortLogname</code> - Set
* to <code>true</code> if you want the last component of the name to be
* included in output messages. Defaults to <code>true</code>.</li>
* <li><code>org.apache.commons.loxx.simplelog.showdatetime</code> - Set to
* <li><code>org.apache.commons.logging.simplelog.showdatetime</code> - Set to
* <code>true</code> if you want the current date and time to be included in
* output messages. Default is <code>false</code>.</li>
* <li><code>org.apache.commons.loxx.simplelog.dateTimeFormat</code> - The
* <li><code>org.apache.commons.logging.simplelog.dateTimeFormat</code> - The
* date and time format to be used in the output messages. The pattern
* describing the date and time format is the same that is used in
* <code>java.text.SimpleDateFormat</code>. If the format is not specified or is
Expand Down Expand Up @@ -107,23 +107,23 @@ public class SimpleLog implements Log, Serializable {

// ---------------------------------------------------- Log Level Constants

/** "Trace" level loxx. */
/** "Trace" level logging. */
public static final int LOG_LEVEL_TRACE = 1;
/** "Debug" level loxx. */
/** "Debug" level logging. */
public static final int LOG_LEVEL_DEBUG = 2;
/** "Info" level loxx. */
/** "Info" level logging. */
public static final int LOG_LEVEL_INFO = 3;
/** "Warn" level loxx. */
/** "Warn" level logging. */
public static final int LOG_LEVEL_WARN = 4;
/** "Error" level loxx. */
/** "Error" level logging. */
public static final int LOG_LEVEL_ERROR = 5;
/** "Fatal" level loxx. */
/** "Fatal" level logging. */
public static final int LOG_LEVEL_FATAL = 6;

/** Enable all loxx levels */
/** Enable all logging levels */
public static final int LOG_LEVEL_ALL = (LOG_LEVEL_TRACE - 1);

/** Enable no loxx levels */
/** Enable no logging levels */
public static final int LOG_LEVEL_OFF = (LOG_LEVEL_FATAL + 1);

// ------------------------------------------------------------ Initializer
Expand Down Expand Up @@ -245,11 +245,11 @@ public SimpleLog(String name) {

/**
* <p>
* Set loxx level.
* Set logging level.
* </p>
*
* @param currentLogLevel
* new loxx level
* new logging level
*/
public void setLevel(int currentLogLevel) {

Expand All @@ -259,7 +259,7 @@ public void setLevel(int currentLogLevel) {

/**
* <p>
* Get loxx level.
* Get logging level.
* </p>
*/
public int getLevel() {
Expand All @@ -271,7 +271,7 @@ public int getLevel() {

/**
* <p>
* Do the actual loxx. This method assembles the message and then calls
* Do the actual logging. This method assembles the message and then calls
* <code>write()</code> to cause it to be written.
* </p>
*
Expand Down
20 changes: 10 additions & 10 deletions jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@
* SLF4JBridgeHandler.install();
*
* // usual pattern: get a Logger and then log a message
* java.util.loxx.Logger julLogger = java.util.loxx.Logger
* java.util.logging.Logger julLogger = java.util.logging.Logger
* .getLogger(&quot;org.wombat&quot;);
* julLogger.fine(&quot;hello world&quot;); // this will get redirected to SLF4J
* </pre>
*
* <p>
* Please note that translating a java.util.loxx event into SLF4J incurs the
* Please note that translating a java.util.logging event into SLF4J incurs the
* cost of constructing {@link LogRecord} instance regardless of whether the
* SLF4J logger is disabled for the given level. <b>Consequently, j.u.l. to
* SLF4J translation can seriously impact on the cost of disabled loxx
* SLF4J translation can seriously impact on the cost of disabled logging
* statements (60 fold increase) and a measurable impact on enabled log
* statements (20% overall increase). </b>
* </p>
*
* <p>
* If application performance is a concern, then use of SLF4JBridgeHandler is
* appropriate only if few j.u.l. loxx statements are in play.
* appropriate only if few j.u.l. logging statements are in play.
*
* @author Christian Stein
* @author Joern Huxhorn
Expand All @@ -97,7 +97,7 @@
*/
public class SLF4JBridgeHandler extends Handler {

// The caller is java.util.loxx.Logger
// The caller is java.util.logging.Logger
private static final String FQCN = java.util.logging.Logger.class.getName();
private static final String UNKNOWN_LOGGER_NAME = "unknown.jul.logger";

Expand All @@ -110,7 +110,7 @@ public class SLF4JBridgeHandler extends Handler {
* Adds a SLF4JBridgeHandler instance to jul's root logger.
*
* <p>
* This handler will redirect jul loxx to SLF4J. However, only logs enabled
* This handler will redirect jul logging to SLF4J. However, only logs enabled
* in j.u.l. will be redirected. For example, if a log statement invoking a
* j.u.l. logger disabled that statement, by definition, will <em>not</em>
* reach any SLF4JBridgeHandler instance and cannot be redirected.
Expand Down Expand Up @@ -162,7 +162,7 @@ public void flush() {
}

/**
* Return the Logger instance that will be used for loxx.
* Return the Logger instance that will be used for logging.
*/
protected Logger getSLF4JLogger(LogRecord record) {
String name = record.getLoggerName();
Expand Down Expand Up @@ -238,7 +238,7 @@ private String getMessageI18N(LogRecord record) {
/**
* Publish a LogRecord.
* <p>
* The loxx request was made initially to a Logger object, which
* The logging request was made initially to a Logger object, which
* initialized the LogRecord and forwarded it here.
* <p>
* This handler ignores the Level attached to the LogRecord, as SLF4J cares
Expand All @@ -256,9 +256,9 @@ public void publish(LogRecord record) {

Logger slf4jLogger = getSLF4JLogger(record);
String message = record.getMessage(); // can be null!
// this is a check to avoid calling the underlying loxx system
// this is a check to avoid calling the underlying logging system
// with a null message. While it is legitimate to invoke j.u.l. with
// a null message, other loxx frameworks do not support this.
// a null message, other logging frameworks do not support this.
// see also http://bugzilla.slf4j.org/show_bug.cgi?id=108
if (message == null) {
message = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SLF4JBridgeHandlerPerfTest extends TestCase {
static int RUN_LENGTH = 100*1000;


// set to false to test enabled loxx performance
// set to false to test enabled logging performance
boolean disabledLogger = true;

FileAppender fileAppender;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Logback: the reliable, generic, fast and flexible loxx framework.
* Logback: the reliable, generic, fast and flexible logging framework.
*
* Copyright (C) 1999-2006, QOS.ch
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Logback: the reliable, generic, fast and flexible loxx framework.
* Logback: the reliable, generic, fast and flexible logging framework.
*
* Copyright (C) 1999-2006, QOS.ch
*
Expand Down
Loading

0 comments on commit 9f10490

Please sign in to comment.