[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Cannot see detail of Hibernate application in Console

Posted on 2011-05-02
3
Medium Priority
?
364 Views
Last Modified: 2012-05-11

Hello there,

Before i used NetBeans default jar files,there it showed me lot of information when i run my test JPA application.then i wanted to use my own jar lib. but now it is not showing me those info.what could be the reason.

cheers
zolf
0
Comment
Question by:zolf
  • 2
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 35503613
because you have changed the logger
check your log4j configuration to see where it is logging to

use a ConsoleAppender if you want to log to console


log4j.rootLogger=info, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
0
 

Author Comment

by:zolf
ID: 35503658

this is what i have now.please help me to print to the console


# To change this template, choose Tools | Templates
# and open the template in the editor.
# Set root logger level to DEBUG and its only appender to CONSOLE.
log4j.rootCategory=DEBUG, FILE

# CONSOLE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n

#define the appender named
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=${user.home}/HibJPA.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-5p %C{1} : %m%n

log4j.appender.FILE.MaxFileSize=1MB
# Keep one backup file
log4j.appender.FILE.MaxBackupIndex=10

# Hibernate debugging levels and their output
log4j.logger.org.hibernate=DEBUG
log4j.logger.net.sf.jasperreports=ERROR
log4j.logger.custom.java.hibernate=DEBUG
log4j.logger.custom.java=DEBUG
log4j.logger.com.MainFormX=DEBUG
log4j.logger.org.hibernate.cache=debug


0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 35503662
> log4j.rootCategory=DEBUG, FILE


change that to


log4j.rootCategory=DEBUG, CONSOLE
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month18 days, 14 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question