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

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)!");<
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/

Databases

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.

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

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.

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

Development Tools & Services

- Technology - Languages
+ Webmasters
+ Development
+ Development Tools
+ Internet
+ Mobile Programming
+ Linux
+ Unix
+ Apple
+ Ubuntu
+ Mobile & Tablets
+ Databases
+ Android
+ Network & Servers
+ Operating Systems
+ Coding
+ Design Software
+ Web Development
+ Game Development
+ Access
+ Excel
+ Web Design
+ Web Hosting
+ Web Site Reviews
+ Domain Name
+ Information Security
+ Software
+ Computers
+ Electronics
+ Hardware
+ Windows
+ PHP
+ ASP/ASP.Net
+ C/C++/C#
+ VB/VB.Net
+ JAVA
+ Javascript
+ Programming
Privacy Policy - Copyrights Notice - Feedback - Report Violation 2018 © BigHow