jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1570685 - in /jmeter/trunk: bin/system.properties bin/user.properties src/jorphan/org/apache/jorphan/logging/LogkitLogger.java xdocs/changes.xml
Date Fri, 21 Feb 2014 19:54:41 GMT
Author: sebb
Date: Fri Feb 21 19:54:41 2014
New Revision: 1570685

URL: http://svn.apache.org/r1570685
Log:
Add Commons Logging interface to logkit logger
Bugzilla Id: 56175

Added:
    jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java   (with props)
Modified:
    jmeter/trunk/bin/system.properties
    jmeter/trunk/bin/user.properties
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/bin/system.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/system.properties?rev=1570685&r1=1570684&r2=1570685&view=diff
==============================================================================
--- jmeter/trunk/bin/system.properties (original)
+++ jmeter/trunk/bin/system.properties Fri Feb 21 19:54:41 2014
@@ -14,20 +14,41 @@
 ##   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.
+
+#    Commons Logging properties
+#    Used by HttpComponents 4.x, see: 
+#    http://hc.apache.org/httpcomponents-client-4.3.x/logging.html
+#
+# Uncomment to enable debugging of Commons Logging setup; may be useful if
+# implementation cannot be instantiated:
+#org.apache.commons.logging.diagnostics.dest=STDERR
+#
+# Uncomment to enable Commons Logging to use standard output
+#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
+#org.apache.commons.logging.simplelog.showdatetime=true
+#
+# Uncomment the following two lines to generate basic debug logging for HC4.x
+#org.apache.commons.logging.simplelog.log.org.apache.http=DEBUG
+#org.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR
+
+# Uncomment the following to tell Commons Logging to output to the JMeter log file: 
+#org.apache.commons.logging.Log=org.apache.jorphan.logging.LogkitLogger
+# Note: in this case, HC4 logging must be configured in user.properties (or jmeter.properties)
+
+# Java networking-related properties
 #
 # For details of Oracle Java network properties, see for example:
 # http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html
 #
-# Sample properties:
-#
 #java.net.preferIPv4Stack=false
 #java.net.preferIPv6Addresses=false
 #networkaddress.cache.ttl=-1
 #networkaddress.cache.negative.ttl=10
+
 #
 #
 # SSL properties (moved from jmeter.properties)
-
+#
 # See http://download.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#Customization
 # for information on the javax.ssl system properties
 

Modified: jmeter/trunk/bin/user.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/user.properties?rev=1570685&r1=1570684&r2=1570685&view=diff
==============================================================================
--- jmeter/trunk/bin/user.properties (original)
+++ jmeter/trunk/bin/user.properties Fri Feb 21 19:54:41 2014
@@ -62,3 +62,8 @@
 
 # Enable Proxy request debug
 #log_level.jmeter.protocol.http.proxy.HttpRequestHdr=DEBUG
+
+# HttpComponents logging configuration when using LogkitLogger
+# Uncomment the following 2 lines for basic debug logging
+#log_level.org.apache.http=DEBUG
+#log_level.org.apache.http.wire=ERROR

Added: jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java?rev=1570685&view=auto
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java (added)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java Fri Feb 21 19:54:41
2014
@@ -0,0 +1,126 @@
+/*
+ * 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.jorphan.logging;
+
+import org.apache.log.Logger;
+import org.apache.commons.logging.Log;
+
+/**
+ * Implementation of Commons Logging Log interface that delegates all
+ * logging calls to Avalon Logkit 
+ */
+public class LogkitLogger implements Log {
+
+    private final Logger logger;
+
+    public LogkitLogger(String category) {
+        logger = LoggingManager.getLoggerFor(category);
+    }
+
+    @Override
+    public void debug(Object message) {
+        logger.debug(String.valueOf(message));
+    }
+
+    @Override
+    public void debug(Object message, Throwable throwable) {
+        logger.debug(String.valueOf(message), throwable);
+    }
+
+    @Override
+    public void error(Object message) {
+        logger.error(String.valueOf(message));
+    }
+
+    @Override
+    public void error(Object message, Throwable throwable) {
+        logger.error(String.valueOf(message), throwable);
+    }
+
+    @Override
+    public void fatal(Object message) {
+        logger.fatalError(String.valueOf(message));
+    }
+
+    @Override
+    public void fatal(Object message, Throwable throwable) {
+        logger.fatalError(String.valueOf(message), throwable);
+    }
+
+    @Override
+    public void info(Object message) {
+        logger.info(String.valueOf(message));
+    }
+
+    @Override
+    public void info(Object message, Throwable throwable) {
+        logger.info(String.valueOf(message), throwable);
+    }
+
+    @Override
+    public boolean isDebugEnabled() {
+        return logger.isDebugEnabled();
+    }
+
+    @Override
+    public boolean isErrorEnabled() {
+        return logger.isErrorEnabled();
+    }
+
+    @Override
+    public boolean isFatalEnabled() {
+        return logger.isFatalErrorEnabled();
+    }
+
+    @Override
+    public boolean isInfoEnabled() {
+        return logger.isInfoEnabled();
+    }
+
+    @Override
+    public boolean isTraceEnabled() {
+        return isDebugEnabled(); // Trace level is not supported, so we use debug
+    }
+
+    @Override
+    public boolean isWarnEnabled() {
+        return logger.isWarnEnabled();
+    }
+
+    @Override
+    public void trace(Object message) {
+        debug(message); // Trace level is not supported, so we use debug
+    }
+
+    @Override
+    public void trace(Object message, Throwable throwable) {
+        debug(message, throwable); // Trace level is not supported, so we use debug
+    }
+
+    @Override
+    public void warn(Object message) {
+        logger.warn(String.valueOf(message));
+    }
+
+    @Override
+    public void warn(Object message, Throwable throwable) {
+        logger.warn(String.valueOf(message), throwable);
+    }
+
+}

Propchange: jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jmeter/trunk/src/jorphan/org/apache/jorphan/logging/LogkitLogger.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1570685&r1=1570684&r2=1570685&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Feb 21 19:54:41 2014
@@ -195,7 +195,8 @@ A workaround is to use a Java 7 update 4
 
 <h3>General</h3>
 <ul>
-<li><bugzilla>21695</bugzilla> -  Unix jmeter start script assumes it is
on PATH, not a link</li>
+<li><bugzilla>21695</bugzilla> - Unix jmeter start script assumes it is
on PATH, not a link</li>
+<li><bugzilla>65175</bugzilla> - Add Commons Logging interface to logkit
logger</li>
 </ul>
 
 <ch_section>Non-functional changes</ch_section>



Mime
View raw message