on 06-07-2006 3:14 PM
I am trying to solve some Hibernate problem, so i need the logging.
I have this properties file:
#set the level of the root logger
log4j.rootLogger = info, file
#set logger file
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%p [%t] %c{2} (%M:%L) :: %m%n
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.logger.org.hibernate=debug, file
I put this file in the web-inf/classes folder of my web project, but no logfile is made.
What must I do get the messages in a logfile?
<b>log4j.appender.file.File=hibernate.log</b>
since you din't specify the absolute path, this will get generated in the directory where the java command is...
ideally you should specify an absolute path where the user with whose credentials the server has been started has write access.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you sure the configuration file is read at all?
have u specified the the log4j configuration file in ur web.xml?
<web-app id="WebApp">
<display-name>anyApplic</display-name>
<servlet>
<servlet-name>Log4jInit</servlet-name>
<display-name>Log4jInit</display-name>
<servlet-class>de.myProject.tools.log4j.Log4jInit</servlet-class>
<init-param>
<param-name>log4j-init-file</param-name>
<param-value>/WEB-INF/log4j.lcf</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.