[jboss-svn-commits] JBoss Common SVN: r2310 - in common-logging-log4j/trunk: src/main/java/org/jboss/logging and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Mar 29 06:52:15 EDT 2007
Author: dimitris at jboss.org
Date: 2007-03-29 06:52:14 -0400 (Thu, 29 Mar 2007)
New Revision: 2310
Modified:
common-logging-log4j/trunk/pom.xml
common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java
common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java
Log:
JBCOMMON-20, Map the jboss TRACE level logging to log4j TRACE
Modified: common-logging-log4j/trunk/pom.xml
===================================================================
--- common-logging-log4j/trunk/pom.xml 2007-03-29 10:32:28 UTC (rev 2309)
+++ common-logging-log4j/trunk/pom.xml 2007-03-29 10:52:14 UTC (rev 2310)
@@ -42,7 +42,7 @@
<dependency>
<groupId>apache-log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.8</version>
+ <version>1.2.14</version>
<scope>compile</scope>
</dependency>
</dependencies>
Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java 2007-03-29 10:32:28 UTC (rev 2309)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/XLevel.java 2007-03-29 10:52:14 UTC (rev 2310)
@@ -1,49 +1,47 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.logging;
import org.apache.log4j.Level;
/**
* Provides custom extention levels for use with the Log4j logging framework.
- *
* <p>
* Adds a trace level that is below the standard Log4j <tt>DEBUG</tt> level.
- *
* <p>
- * This is a custom level that is 100 below the {@link Level#DEBUG_INT}
+ * This is a custom level that is 100 below the {@link Level#TRACE_INT}
* and represents a lower level useful for logging events that should only
* be displayed when deep debugging is required.
*
* @see org.apache.log4j.Level
- *
+ * @deprecated as log4j 1.2.14 has a native TRACE level
+ *
* @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
* @version $Revision$
*/
-public class XLevel
- extends Level
+public class XLevel extends Level
{
- /** The integer representation of the level, ({@link Level#DEBUG_INT} - 100) */
- public static final int TRACE_INT = Level.DEBUG_INT - 100;
+ /** The integer representation of the level, ({@link Level#TRACE_INT} - 100) */
+ public static final int TRACE_INT = Level.TRACE_INT - 100;
/** The string name of the trace level. */
public static final String TRACE_STR = "TRACE";
Modified: common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java
===================================================================
--- common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java 2007-03-29 10:32:28 UTC (rev 2309)
+++ common-logging-log4j/trunk/src/main/java/org/jboss/logging/log4j/Log4jLoggerPlugin.java 2007-03-29 10:52:14 UTC (rev 2310)
@@ -1,29 +1,29 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.logging.log4j;
-import org.apache.log4j.LogManager;
-import org.apache.log4j.Level;
import org.apache.log4j.Category;
+import org.apache.log4j.Level;
+import org.apache.log4j.LogManager;
import org.apache.log4j.Priority;
import org.jboss.logging.Logger;
import org.jboss.logging.LoggerPlugin;
@@ -38,21 +38,7 @@
*
* @author <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
* @version $Revision$
- *
- * <p><b>Revisions:</b>
- *
- * <p><b>3. mai 2002 Sacha Labourey:</b>
- * <ul>
- * <li> First implementation </li>
- * </ul>
- * </p>
- * <p><b>4. february 2003 Dag Liodden:</b>
- * <ul>
- * <li>Fixed Log4J locationinfo by sending the fully qualified classname of <code>Logger</code> to Log4J</li>
- * </ul>
- * </p>
*/
-
public class Log4jLoggerPlugin implements LoggerPlugin
{
@@ -99,27 +85,28 @@
public boolean isTraceEnabled()
{
- if (log.isEnabledFor(XLevel.TRACE) == false)
+ Level l = Level.TRACE;
+ if (log.isEnabledFor(l) == false)
return false;
- return XLevel.TRACE.isGreaterOrEqual(log.getEffectiveLevel());
+ return l.isGreaterOrEqual(log.getEffectiveLevel());
}
/**
* Issue a log msg with a level of TRACE.
- * Invokes log.log(XLevel.TRACE, message);
+ * Invokes log.log(Level.TRACE, message);
*/
public void trace(Object message)
{
- log.log(FQCN, XLevel.TRACE, message, null);
+ log.log(FQCN, Level.TRACE, message, null);
}
/**
* Issue a log msg and throwable with a level of TRACE.
- * Invokes log.log(XLevel.TRACE, message, t);
+ * Invokes log.log(Level.TRACE, message, t);
*/
public void trace(Object message, Throwable t)
{
- log.log(FQCN, XLevel.TRACE, message, t);
+ log.log(FQCN, Level.TRACE, message, t);
}
/**
More information about the jboss-svn-commits
mailing list