You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2015/02/10 22:53:59 UTC
[2/2] cxf git commit: [CXF-6251] Allowing system property for message
logging to do pretty printing This closes #53
[CXF-6251] Allowing system property for message logging to do pretty printing
This closes #53
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/48084ffd
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/48084ffd
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/48084ffd
Branch: refs/heads/3.0.x-fixes
Commit: 48084ffd0625178e758c52ffcf2b695206ef8015
Parents: d2a0c47
Author: Kyle Lape <ky...@redhat.com>
Authored: Sun Feb 8 18:52:46 2015 -0800
Committer: Daniel Kulp <dk...@apache.org>
Committed: Tue Feb 10 16:53:46 2015 -0500
----------------------------------------------------------------------
.../cxf/bus/extension/ExtensionManagerBus.java | 29 ++++++++++++++------
1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/48084ffd/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java b/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
index 0478279..909ed8a 100644
--- a/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
+++ b/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
@@ -61,19 +61,28 @@ import org.apache.cxf.transport.DestinationFactoryManager;
public class ExtensionManagerBus extends AbstractBasicInterceptorProvider implements Bus {
public static final String BUS_PROPERTY_NAME = "bus";
static final boolean FORCE_LOGGING;
+ static final boolean FORCE_PRETTY;
static {
boolean b = false;
+ boolean pretty = false;
try {
- b = Boolean.getBoolean("org.apache.cxf.logging.enabled");
- //treat these all the same
- b |= Boolean.getBoolean("com.sun.xml.ws.transport.local.LocalTransportPipe.dump");
- b |= Boolean.getBoolean("com.sun.xml.ws.util.pipe.StandaloneTubeAssembler.dump");
- b |= Boolean.getBoolean("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump");
- b |= Boolean.getBoolean("com.sun.xml.ws.transport.http.HttpAdapter.dump");
+ String prop = System.getProperty("org.apache.cxf.logging.enabled", "false");
+ if ("pretty".equals(prop)) {
+ b = true;
+ pretty = true;
+ } else {
+ b = Boolean.parseBoolean(prop);
+ //treat these all the same
+ b |= Boolean.getBoolean("com.sun.xml.ws.transport.local.LocalTransportPipe.dump");
+ b |= Boolean.getBoolean("com.sun.xml.ws.util.pipe.StandaloneTubeAssembler.dump");
+ b |= Boolean.getBoolean("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump");
+ b |= Boolean.getBoolean("com.sun.xml.ws.transport.http.HttpAdapter.dump");
+ }
} catch (Throwable t) {
//ignore
}
FORCE_LOGGING = b;
+ FORCE_PRETTY = pretty;
}
private static final String BUS_ID_PROPERTY_NAME = "org.apache.cxf.bus.id";
@@ -102,7 +111,9 @@ public class ExtensionManagerBus extends AbstractBasicInterceptorProvider implem
CXFBusFactory.possiblySetDefaultBus(this);
if (FORCE_LOGGING) {
- features.add(new LoggingFeature());
+ LoggingFeature feature = new LoggingFeature();
+ feature.setPrettyLogging(FORCE_PRETTY);
+ features.add(feature);
}
if (null == properties) {
properties = new HashMap<String, Object>();
@@ -345,7 +356,9 @@ public class ExtensionManagerBus extends AbstractBasicInterceptorProvider implem
this.features.clear();
this.features.addAll(features);
if (FORCE_LOGGING) {
- this.features.add(new LoggingFeature());
+ LoggingFeature feature = new LoggingFeature();
+ feature.setPrettyLogging(FORCE_PRETTY);
+ this.features.add(feature);
}
if (state == BusState.RUNNING) {
initializeFeatures();