有没有引入log4j.jar,没有的话,你改log4j.properties也没用

解决方案 »

  1.   

    show_sql设成false肯定不会输出SQL语句的了,看看hibernate.properties是不是真的设对了。
      

  2.   

    >肯定是引入了啊,要不然肯定运行时会包错的拉<
    不会报错的,它会采用其他log工具,
    只有引入log4j.jar,它才采用log4j把你的log4j.properties贴出来吧
      

  3.   

    miwoo(miwoo)兄弟,以下是我的log4j.properties文件内容:
    # For the general syntax of property based configuration files see the
    # documenation of org.apache.log4j.PropertyConfigurator.# The root category uses the appender called A1. Since no priority is
    # specified, the root category assumes the default priority for root
    # which is DEBUG in log4j. The root category is the only category that
    # has a default priority. All other categories need not be assigned a
    # priority in which case they inherit their priority from the
    # hierarchy.#log4j.rootCategory=ERROR,A1
    # Set root logger level to DEBUG and its only appender to A1.
    log4j.rootLogger=ERROR,A1
    # A1 is set to be a ConsoleAppender.
    #log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1=org.apache.log4j.FileAppender
    log4j.appender.A1.File=C:/GBase/NsLog4j_debug.log
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout# Print the date in ISO 8601 format
    log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n# A1 is set to be a LF5Appender which outputs to a swing
    # logging console.#log4j.appender.A1=org.apache.log4j.lf5.LF5Appender
    #log4j.appender.A1.MaxNumberOfRecords=1000
      

  4.   

    miwoo(miwoo)兄弟,以下是我的log4j.properties文件内容:
    # For the general syntax of property based configuration files see the
    # documenation of org.apache.log4j.PropertyConfigurator.# The root category uses the appender called A1. Since no priority is
    # specified, the root category assumes the default priority for root
    # which is DEBUG in log4j. The root category is the only category that
    # has a default priority. All other categories need not be assigned a
    # priority in which case they inherit their priority from the
    # hierarchy.#log4j.rootCategory=ERROR,A1
    # Set root logger level to DEBUG and its only appender to A1.
    log4j.rootLogger=ERROR,A1
    # A1 is set to be a ConsoleAppender.
    #log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1=org.apache.log4j.FileAppender
    log4j.appender.A1.File=C:/GBase/NsLog4j_debug.log
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout# Print the date in ISO 8601 format
    log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n# A1 is set to be a LF5Appender which outputs to a swing
    # logging console.#log4j.appender.A1=org.apache.log4j.lf5.LF5Appender
    #log4j.appender.A1.MaxNumberOfRecords=1000
      

  5.   

    加上下面的试试
    log4j.logger.eg=error
    log4j.logger.net.sf.hibernate=error
    log4j.logger.net.sf.hibernate.type=error
    log4j.logger.net.sf.hibernate.connection=error
    log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=error
      

  6.   

    miwoo(miwoo)兄弟,问题好象还是存在啊!!
      

  7.   

    确定有没有引入log4j.jar贴出一段日志
      

  8.   

    以下是TOMCAT后台不停的抛出的信息:
    2003-09-11 10:30:31,338 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.error.password.mismatch
    2003-09-11 10:30:31,338 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.errors.footer
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.subscription.title.edit
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.mainMenu.heading
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.prompt.password
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.error.bulletin
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources -   Saving message key '.button.save
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - getMessage(zh_CN,errors.suffix)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh_CN)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale()
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - getMessage(zh_CN,errors.header)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh_CN)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - getMessage(zh_CN,role.notfound)
    2003-09-11 10:30:31,348 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh_CN)
    2003-09-11 10:30:31,358 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh)
    2003-09-11 10:30:31,358 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - getMessage(zh_CN,errors.footer)
    2003-09-11 10:30:31,358 [Thread-15] DEBUG org.apache.struts.util.PropertyMessage
    Resources - loadLocale(zh_CN)
      

  9.   

    搞了半天这都是struts的log呀加上
    log4j.logger.org.apache.struts=error
      

  10.   

    hibernate 到底是啥呀?
    这个包,和相关资料,有么?
    指教。
      

  11.   

    我找到了。原来csdn,就有。
    打扰。