camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: [2/3] git commit: CAMEL-6933 Polished the logging information
Date Thu, 07 Nov 2013 01:35:50 GMT

Sorry of the System.out, I will remove shortly. Now I see you point.
Maybe we can introduce some logging feature in the DefaultCamelContext to let check the setting
of System properties to find out which setting could affect the camel runtime.

I just fill JIRA[1] for it, please feel free to add your comments there.

[1]https://issues.apache.org/jira/browse/CAMEL-6943  

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Wednesday, November 6, 2013 at 9:56 PM, Claus Ibsen wrote:

> Thanks for the INFO logging. I like when we log that on startup when
> something like that which is often under the covers configured and
> people don't know about it, or its set on a JVM argument that people
> can't normally see etc.
>  
>  
> There is a System.out that snug in there ;)
>  
> On Wed, Nov 6, 2013 at 2:49 PM, <ningjiang@apache.org (mailto:ningjiang@apache.org)>
wrote:
> > CAMEL-6933 Polished the logging information
> >  
> >  
> > Project: http://git-wip-us.apache.org/repos/asf/camel/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e972555d
> > Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e972555d
> > Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e972555d
> >  
> > Branch: refs/heads/master
> > Commit: e972555d86c182305cd017ef37fb9a09c677d2af
> > Parents: 5489a1b
> > Author: Willem Jiang <willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)>
> > Authored: Wed Nov 6 21:46:55 2013 +0800
> > Committer: Willem Jiang <willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)>
> > Committed: Wed Nov 6 21:49:28 2013 +0800
> >  
> > ----------------------------------------------------------------------
> > .../camel/converter/jaxp/XmlConverter.java | 19 ++++++++++++++++++-
> > 1 file changed, 18 insertions(+), 1 deletion(-)
> > ----------------------------------------------------------------------
> >  
> >  
> > http://git-wip-us.apache.org/repos/asf/camel/blob/e972555d/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
> > ----------------------------------------------------------------------
> > diff --git a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
> > index 79e71b9..ca56d24 100644
> > --- a/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
> > +++ b/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java
> > @@ -27,6 +27,8 @@ import java.io.Reader;
> > import java.io.StringReader;
> > import java.io.StringWriter;
> > import java.nio.ByteBuffer;
> > +import java.util.ArrayList;
> > +import java.util.List;
> > import java.util.Map;
> > import java.util.Properties;
> >  
> > @@ -897,6 +899,7 @@ public class XmlConverter {
> >  
> > protected void setupFeatures(DocumentBuilderFactory factory) {
> > Properties properties = System.getProperties();
> > + List<String> features = new ArrayList<String>();
> > for (Map.Entry<Object, Object> prop : properties.entrySet()) {
> > String key = (String) prop.getKey();
> > if (key.startsWith(XmlConverter.DOCUMENT_BUILDER_FACTORY_FEATURE)) {
> > @@ -904,11 +907,25 @@ public class XmlConverter {
> > Boolean value = Boolean.valueOf((String)prop.getValue());
> > try {
> > factory.setFeature(uri, value);
> > + features.add("feature " + uri + " value " + value);
> > } catch (ParserConfigurationException e) {
> > - LOG.warn("DocumentBuilderFactory doesn't support the feature {0} with value {1},
due to {2}.", new Object[]{uri, value, e});
> > + LOG.warn("DocumentBuilderFactory doesn't support the feature {} with value {},
due to {}.", new Object[]{uri, value, e});
> > }
> > }
> > }
> > + if (features.size() > 0) {
> > + StringBuffer featureString = new StringBuffer();
> > + // just log the configured feature
> > + for (String feature: features) {
> > + if (featureString.length() != 0) {
> > + featureString.append(", ");
> > + }
> > + featureString.append(feature);
> > + }
> > + System.out.println(featureString);
> > + LOG.info (http://LOG.info)("DocumenterBuilderFactory has been set with features
{{}}.", featureString.toString());
> > + }
> > +
> > }
> >  
> > public DocumentBuilderFactory createDocumentBuilderFactory() {
>  
>  
>  
> --  
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen




Mime
View raw message