Hibernate doesn't log anything anymore, since I relocated the log4j.xml and hibernate.properties files



I had the following working organization


src/main/resources/log4j.xml
src/main/resources/hibernate.properties

I wanted to reorganize my webapp as follow:


src/main/resources/log/log4j.xml
src/main/resources/orm/hibernate.properties

The Logger.info("foobar") still logs well (after having set the log4jConfigLocation context parameter), and the app still has a working database connection.


The problem is that Hibernate doesn't log anything anymore, even if hibernate.show_sql is s


Related to : Hibernate doesn't log anything anymore, since I relocated the log4j.xml and hibernate.properties files
How to create log file using log4j in struts2+hibernate application?
Programming Languages

I am using Struts2,hibernate web application. On that file i used following dependency for log4j in pom.xml


<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>

In my Actionclass i used the following code to write log file:


public class loginAction extends action{
static Logger log = Logger.getLogger(com.action.LoginAction.class);
public String checklogin(){
log.debug("Debug Message(LOGIN)!");
log.info("Info Message(LOGIN)!");<
How to log only inserts and updates with Hibernate and log4j?
Programming Languages

I have a spring based webapp using Hibernate to query mysql. When I enable trace logging by using log4j.logger.org.hibernate.type=TRACE, all queries with their parameters are logged to the console. This makes the webapp slow for search queries.


I need to log only modifications to the database. Preferably the insert/update query issued to the mysql server. What is the simplest and most reliable way of doing this?


Can I just ask log4j to log only insert queries?


P6SPY seems overkill for my purpose.
http://sourceforge.net/projects/p6spy/


hibernate.cfg.xml does not find hibernate.properties file
Programming Languages

We used to have the hibernate.cfg.xml and hibernate.properties files in the same folder in our Java source folder. Now I moved the hibernate.properties file to another location. How can I make the hibernate.cfg.xml file find the hibernate.properties file again? I get an error which seems to indicate that it is not found anymore.


Hibernate doesn't log anything anymore, since I relocated the log4j.xml and hibernate.properties files
Programming Languages

I had the following working organization


src/main/resources/log4j.xml
src/main/resources/hibernate.properties

I wanted to reorganize my webapp as follow:


src/main/resources/log/log4j.xml
src/main/resources/orm/hibernate.properties

The Logger.info("foobar") still logs well (after having set the log4jConfigLocation context parameter), and the app still has a working database connection.


The problem is that Hibernate doesn't log anything anymore, even if hibernate.show_sql is s

Can't stop Hibernate from writing log to console (log4j.properties is ok)
Programming Languages

I've already set


<property name="show_sql">false</property>

& disable all messages in log4j.properties


But Hibernate shit to console with all queries & statements.


Why does hibernate not find properties when I have hibernate.cfg.xml in my default package classpath?
Programming Languages

I am having a bitch of a time getting this simple application working. I've got a configuration file in my default class path, using annotations with the correct class entries in the config file, and a default Session factory class that generated by the hibernate eclipse plug in tool. If I only rely on the default classpath config file, I get a hibernate.properties not found. If I add another call early on in app lifecycle that sets the path to the file for the factory object, I get a Duplicate class/entity mapping error. Why would it fail to find the properties, or why might be seeing that error even though the config file is on the classpath? What is the proper way to set the file path


Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .