aspose file tools*
The moose likes Object Relational Mapping and the fly likes Slf4j - Log4j Not Work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Slf4j - Log4j Not Work" Watch "Slf4j - Log4j Not Work" New topic
Author

Slf4j - Log4j Not Work

Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Dear all masters

I get problem create a log in hibernate, i have not see my log.
This my step :
1. In my library i have slf4j-api-1.6.4.jar , slf4j-simple-1.6.4.jar , slf4j-log4j12-1.6.4.jar
2. I create pom.xml file in src/
3. I set pom.xml according to my version of Hibernate and slf4j. I use Hibernate 3.3.0GA
4. I create log4j.properties in src/ and in the log4j i set directory for my log :
D:\\Goes to Campus\Belajar\Hibernate\hibernatefirst.log

But i try to save hibernatefirst.log in D:\\ it works.
What's wrong?

I run my Hibernate Application and it not shown in hibernatefirst.log file.

Please help me..

Thank you..
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

But i try to save hibernatefirst.log in D:\\ it works.
What's wrong?

Have you tried a path without spaces in it (like "D:\\Goes to Campus\..."). Do you get any exceptions?

Can you show your pom.xml? What kind of application is this (standalone, web etc...) and how you run it?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Fandy Akhmad
Ranch Hand

Joined: Nov 26, 2011
Posts: 32

Thanks for your responds..
This is standalone application.

Ya, i try to create 'hibernatefirst.log' file in :
D:\Goes to Campus\Belajar\Hibernate\
I write the path in log.properties like this :

but the log information not save in 'hibernatefirst.log' on the path above.

And i try create in :
D:\
log information can save in 'hibernatefirst.log' file.

How i resolve that path? May be any rules to write a path file in Log4j.


This my pom.xml

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Just try another path without spaces in between (e.g.: D:\\temp\hibernate\hibernatefirst.log)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Slf4j - Log4j Not Work
 
Similar Threads
Doubt in Hibernate Sample Application
Setting up logging
Hibernate+GWT problem related to slf4j
hbm2ddl ant task + Oracle11g XE
Bugged with slf4j