Win a copy of Head First Android this week in the Android forum!

Ravi Singh

Greenhorn
+ Follow
since Sep 17, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ravi Singh

Dear friends

Need help with logging logs into database using JDK 1.1.8. Please read through my .java and properties file attached below. Also please note this application works well with JDK 1.5.

I get runtime error while parsing the properties file (just before commencing parsing for database appender part), saying "Can't find class TestJDBCLogging"

I've also tried setting classpath to C:\log4j\HelloWorld inside System Environment Variables...but no luck. Moreover I've tried using various versions of log4j jars starting from ver. 1.2.1 to 1.2.7 but still same situation...however, using ver 1.2.7 onwards gives compile-time errors on JDK 1.1.8.






Directory structure ->

Location of .java, .class and properties file -
C:\log4j\HelloWorld

Location of library jar files (log4j-1.2.7 and jdbc driver etc) -
C:\log4j\HelloWorld\lib

Looking forward to your replies...

Ravi Singh
I've got my program working now. I was using the wrong version of log4j library in my build path. Thanks for your pointer, Ulf...

Cheers!
Ravi Singh
Yes the program works fine if I remove (or comment) the database appender settings in properties file.
Hi,

I need help with log4j logging tool (org.apache.log4j.*) to log into database using JDBCAppender. Have look at my logger code and corresponding log4j.properties file stated below. I'm running this program using Eclipse IDE and it's giving me the following error (in bold) at the end:

log4j: Parsing for [root] with value=[debug, stdout, Roll, CRSDBAPPENDER].
log4j: Level token is [debug].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%x %d{HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Parsing appender named "Roll".
log4j: Parsing layout options for "Roll".
log4j: Setting property [conversionPattern] to [%x %d{yyyy.MM.dd HH:mm:ss,SSS} %5p [%t] (%c:%-4L %M) - %m%n].
log4j: End of parsing for "Roll".
log4j: Setting property [file] to [HelloWorld.log].
log4j: Setting property [maxBackupIndex] to [10].
log4j: Setting property [maxFileSize] to [20KB].
log4j: setFile called: HelloWorld.log, true
log4j: setFile ended
log4j: Parsed "Roll" options.
log4j: Parsing appender named "CRSDBAPPENDER".

Can't find class HelloWorld







Here is the directory structure of my program. My log4j.properties file and HelloWorld.class file are residing in folder HelloWorld\bin.

HelloWorld\bin
HelloWorld\lib
HelloWorld\src

Please note - The same program works fine for console and file appender when I comment the database appender part in my properties file.
Thanks
Ravinder
[ September 17, 2007: Message edited by: Ulf Dittmer ]