-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: turning down logging for HV
PostPosted: Wed Jun 14, 2017 12:43 pm 
Regular
Regular

Joined: Mon Aug 07, 2006 6:22 pm
Posts: 67
After enabling Hibernate Validator in my code, I'm seeing lots of messages like the following:
Quote:
[org.jboss.logging] : Logging Provider: org.jboss.logging.Log4j2LoggerProvider Ignored FQCN: org.jboss.logging.Logger
[org.hibernate.validator.internal.util.Version] : HV000001: Hibernate Validator 5.4.1.Final Ignored FQCN: org.hibernate.validator.internal.util.logging.Log_$logger
[org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] : Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.engine.ConfigurationImpl] : Setting custom MessageInterpolator of type org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.xml.ValidationXmlParser] : Trying to load META-INF/validation.xml for XML based Validator configuration. Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.xml.ResourceLoaderHelper] : Trying to load META-INF/validation.xml via user class loader Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.xml.ResourceLoaderHelper] : Trying to load META-INF/validation.xml via TCCL Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.xml.ResourceLoaderHelper] : Trying to load META-INF/validation.xml via Hibernate Validator's class loader Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.xml.ValidationXmlParser] : No META-INF/validation.xml found. Using annotation based configuration only. Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.resourceloading.PlatformResourceBundleLocator] : ValidationMessages not found. Ignored FQCN: org.jboss.logging.Logger


Is there anything I should note from this? How can I turn off this logging?


Top
 Profile  
 
 Post subject: Re: turning down logging for HV
PostPosted: Thu Jun 15, 2017 3:05 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Most of these messages are logged on debug level. So you have turned on debug logging for the "org.hibernate.validator" package. How to change that depends on the logging framework you use (HV works with JBoss Logging which just routes log calls to your actually used logger API). Given you're on OSGi, I'd expect some change to the configuration of the OSGi Logging Service is required.

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
 Post subject: Re: turning down logging for HV
PostPosted: Thu Jun 15, 2017 11:57 am 
Regular
Regular

Joined: Mon Aug 07, 2006 6:22 pm
Posts: 67
I can demonstrate this in my unit test, which is not running in an OSGi container.

I set up a "log4j.xml" file with level=WARN, made sure it's found in the classpath, and even turned on "log4j.debug" to show what log4j is finding. No change. Here's some output:
Quote:
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@1996cd68.
log4j: Using URL [file:..../target/test-classes/log4j.xml] for automatic log4j configuration.
log4j: Preferred configurator class: org.apache.log4j.xml.DOMConfigurator
log4j: System property is :null
log4j: Standard DocumentBuilderFactory search succeded.
log4j: DocumentBuilderFactory is: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
log4j: debug attribute= "null".
log4j: Ignoring debug attribute.
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Retreiving an instance of org.apache.log4j.Logger.
log4j: Setting [org.hibernate.validator] additivity to [false].
log4j: Level value for org.hibernate.validator is [warn].
log4j: org.hibernate.validator level set to WARN
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [target] to [System.out].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [%-5p %c{1} - %m%n].
log4j: Adding appender named [ConsoleAppender] to category [org.hibernate.validator].
log4j: Level value for root is [warn].
log4j: root level set to WARN
[org.jboss.logging] : Logging Provider: org.jboss.logging.Log4j2LoggerProvider Ignored FQCN: org.jboss.logging.Logger
[org.hibernate.validator.internal.util.Version] : HV000001: Hibernate Validator 5.4.1.Final Ignored FQCN: org.hibernate.validator.internal.util.logging.Log_$logger
[org.hibernate.validator.internal.engine.resolver.DefaultTraversableResolver] : Cannot find javax.persistence.Persistence on classpath. Assuming non JPA 2 environment. All properties will per default be traversable. Ignored FQCN: org.jboss.logging.DelegatingBasicLogger
[org.hibernate.validator.internal.engine.ConfigurationImpl] : Setting custom MessageInterpolator of type org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator Ignored FQCN: org.jboss.logging.DelegatingBasicLogger


Top
 Profile  
 
 Post subject: Re: turning down logging for HV
PostPosted: Fri Jun 16, 2017 10:01 am 
Regular
Regular

Joined: Mon Aug 07, 2006 6:22 pm
Posts: 67
This turned out to be a classpath issue, but not because I was running in an OSGi container. It was because the jars for PaxExam were in the classpath, because the project has other tests that are PaxExam tests. I can tweak this in the Maven build to exclude those in the unit tests, but Eclipse isn't going to use the Surefire configuration to run unit tests, so avoiding this while running interactively in Eclipse requires setting a property in each run configuration, which almost makes it not worth the trouble to deal with.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.