我是新来冬眠,我在Eclipse中做项目。 当我登录到我的应用程序会显示在控制台中,我不需要很多日志消息,日志消息是这样的,
97 [http-bio-8080-exec-9] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
102 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Environment - Hibernate 3.6.10.Final
103 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Environment - hibernate.properties not found
105 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
108 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
165 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
165 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
220 [http-bio-8080-exec-9] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
262 [http-bio-8080-exec-9] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.aurodisplay.its.beans.UserRegisterBean
296 [http-bio-8080-exec-9] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.aurodisplay.its.beans.UserRegisterBean on table users
334 [http-bio-8080-exec-9] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.aurodisplay.its.beans.AdminInfoBean
334 [http-bio-8080-exec-9] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.aurodisplay.its.beans.AdminInfoBean on table admin_info
337 [http-bio-8080-exec-9] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.aurodisplay.its.beans.LatitudeBean
337 [http-bio-8080-exec-9] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.aurodisplay.its.beans.LatitudeBean on table latlng
我的hibernate.cfg.xml
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/its_serverdb</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">10</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>
<property name="hibernate.connection.release_mode">on_close</property>
// next are mappings
我已经集成Log4j的,这是我的log4j.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{dd-MM-yyyy HH:mm:ss}] [%c{1}] %-5p :%L - %m%n" />
</layout>
</appender>
<appender name="file" class="org.apache.log4j.RollingFileAppender">
<param name="append" value="false" />
<param name="maxFileSize" value="10MB" />
<param name="maxBackupIndex" value="10" />
<param name="file" value="${catalina.home}/logs/ITS_Server.log" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{dd-MM-yyyy HH:mm:ss}] [%c{1}] %-5p:%L - %m%n" />
</layout>
</appender>
<category name="org.hibernate">
<priority value="DEBUG" />
</category>
<category name="java.sql">
<priority value="debug" />
</category>
<logger name="org.hibernate">
<level value="info"/>
</logger>
<root>
<level value="DEBUG" />
<appender-ref ref="console" />
<appender-ref ref="file" />
</root>
</log4j:configuration>
我如何可以禁用它。 当我google一下吧,somany解决方案是使用Log4j
我不知道它是什么,什么是它。 我该怎么办没有禁用日志Log4j
如果可能的话,请告诉我。它怎么会是马丽娟帮助。 谢谢。