`

WARN No appenders could be found for logger (org.hibernate.cfg.Environment)

阅读更多

在配置完Hibernate,运行时出现错误:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.

解决办法如下:

src下面新建file名为log4j.properties内容如下:

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
### root logger option ###
log4j.rootLogger=warn, stdout
### Hibernate logging options ###
log4j.logger.net.sf.hibernate=info
### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=info
### log PreparedStatement cache activity ###
log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=info

分享到:
评论

相关推荐

    log4j:WARN No appenders could be found for logger (org.springframework.context.s

    NULL 博文链接:https://wait7758521.iteye.com/blog/1933964

    log4j.properties

    1.log4j:WARNNoappenderscouldbefoundforlogger(org.apache.hadoop.util.Shell). 2.log4j:WARNPleaseinitializethelog4jsystemproperly. 3.log4j:WARNSeehttp://logging.apache.org/log4j/1.2/faq....

    JAVACCC.DLL

    log4j:WARN No appenders could be found for logger org apache commons beanutils ConvertUtils 出现这个错误 在web inf classes路径下加了log4j properties文件还是这个错误log4j:WARN Please initialize the ...

    log4j日志报错解决办法

    首先,错误信息"log4j:WARN No appenders could be found for logger"表明Log4j找不到任何日志输出的目标,也就是没有设置日志appender。日志appender是Log4j用来定义日志输出目的地的组件,比如控制台、文件、邮件...

    quartz log4j

    log4j:WARN No appenders could be found for logger (com.mchange.v2.log.MLog). log4j:WARN Please initialize the log4j system properly.

    log4j-1.2.14.jar

    报错WARN No appenders could be found for logger 或 WARN Please initialize the log4j system properly时需要引入的包。用法可以参考https://blog.csdn.net/u010912188/article/details/79761894

    log4j-appenders

    3. 日志级别与过滤器:根据需求设置不同级别的日志输出,如DEBUG、INFO、WARN、ERROR等,并可以配合Filter组件进行更精确的控制。 4. 性能监控:为了保证日志系统的健康运行,需要定期监控ASYNC Appender的性能指标...

    hadoop-2.6.0-hadoop.dll-winutils.exe

    log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See ...

    schemacrawler-hive:适用于Apache Hive的SchemaCrawler插件

    模式爬虫配置单元 不幸的是,到目前为止, 似乎是不切实际的。 从hive-1.1.0(CDH5.4)开始,...log4j:WARN No appenders could be found for logger (org.apache.hive.jdbc.Utils). log4j:WARN Please initialize the

    struts2驱动包

    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. 2009-8-29 14:02:12 org.apache.catalina.core....

    clj-hbase:小型且不完整的 hbase 0.98.3 clojure 包装器

    clj-hbase 这是一个用于 hbase 0.98.3 的小型且仍然不完整的 clojure 包装器 用法 假设我们有一个带有列族“byte-data...log4j:WARN No appenders could be found for logger ( org.apache.hadoop.metrics2.lib.Mutabl

    hanging-chad:演示两个ZK客户可以一次认为自己是领导者

    玩具应用程序可证明参加动物园管理员领导者选举食谱的多个客户可以随时认为自己是领导者。 建造 建立: $ ../gradlew jar 这将在build / libs中创建...log4j:WARN No appenders could be found for logger (org

    com.springsource.org.apache.log4j-1.2.16.jar

    log4j.logger.example.MyClass=WARN ``` 四、实践应用 在实际开发中,Log4j 1.2.16广泛应用于系统调试、性能监控、故障排查等场景。通过合理配置,可以有效收集运行时信息,辅助开发者定位问题,提高开发效率。...

    spring lib j2ee

    #1 定義了兩個輸出端 level = LOG,INFO,WARN,ERROR,FATAL ###定義某個包下的所有類錯誤級別 log4j.rootLogger = INFO,A1 log4j.addivity.org.apache=true log4j.logger.com.ibatis = ERROR log4j.logger....

    log4j.properties配置详解

    log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN log4j.logger.org.hibernate=DEBUG log4j.logger.org.logicalcobwebs=WARN ``` 这段配置的关键组成部分解释如下: 1. **根日志类别** (`log4j.root...

    tomcat排错经典案例之404.docx

    log4j:WARN No appenders could be found for logger (org.apache.mons.digester.Digester). log4j:WARN Please initialize the log4j system properly. 2009-11-06 21:39:17 org.apache.catalina.core....

    log4j日志使用说明

    log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN log4j.logger.org.hibernate=DEBUG log4j.logger.org.logicalcobwebs=WARN ``` #### 三、配置文件各属性解释 - **log4j.rootCategory**: 定义根日志...

    深入了解log4j配置说明

    log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN log4j.logger.org.hibernate=DEBUG log4j.logger.org.logicalcobwebs=WARN ``` 这些配置意味着对于`com.neusoft`包中的类,其日志级别被设为DEBUG;而...

Global site tag (gtag.js) - Google Analytics