-->
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.  [ 2 posts ] 
Author Message
 Post subject: direct messages to file hibernate.log
PostPosted: Tue Feb 14, 2006 8:56 am 
Beginner
Beginner

Joined: Mon Oct 24, 2005 2:45 am
Posts: 23
I have modified log.properties to send all my hibernate related log files to

hibernate.log. But i am getting following error.

In my struts application can i have one more log file for writing my Application level logs in my Action class ?


------------------------------------

### 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


### direct messages to file hibernate.log ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=hibernate.log
#log4j.appender.file.File=c:\\hibernate.log
#log4j.appender.file.File=E:\\\\OC4J\\j2ee\\home\\applications\\example2\\WEB-INF\\hlog\\hibernate.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n


--------------------------------
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
F:\oc4j_extended\j2ee\home>java -mx512M -jar oc4j.jar
06/02/14 18:11:28 Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
initialized
06/02/14 18:12:46 log4j:ERROR Could not find value for key log4j.appender.stdout

06/02/14 18:12:46 log4j:ERROR Could not instantiate appender named "stdout".



Name and version of the database you are using:
SQL Server 2000


The generated SQL (show_sql=true):



Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 14, 2006 5:32 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Something in your code (or hibernate's) is hardwired to use the stdout appender, by the looks of it. Uncomment the stdout lines at the beginning.

You can have as many appenders as you like. You can even point them at the same file, and log4j will handle it cleanly. If you don't want anything going to the console, then you direct the stdout appender to hibernate.log, or to a new file, maybe "console.out":
Code:
### Don't direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.FileAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.stdout.File=c:\\console.out


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.