I'm using log4cxx on both Windows and Linux.
Here's my conf file:
------------------------------------------------
log4j.rootLogger=INFO, logFile, database
# Local log file settings for the application
log4j.appender.logFile=org.apache.log4j.RollingFileAppender
log4j.appender.logFile.File=server.log
log4j.appender.logFile.MaxFileSize=100KB
# Keep one backup file
log4j.appender.logFile.MaxBackupIndex=1
log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
log4j.appender.logFile.layout.ConversionPattern=%5p %d [%t] - %m%n
# Database appender (using PostgreSQL ODBC)
log4j.appender.database=org.apache.log4j.ODBCAppender
log4j.appender.database.URL=postgresql
log4j.appender.database.layout=org.apache.log4j.PatternLayout
log4j.appender.database.layout.ConversionPattern=%5p %d %m%n
log4j.appender.database.sql=INSERT INTO events ( level, date, message )
VALUES ('%5p', '%d', '%m%n' )
------------------------------------------------
This works perfectly under Windows.
On Linux, I get the following output when I run my app:
Class 'org.apache.log4j.ODBCAppender' not found
Could not instantiate appender named "database"
When I configured on Linux, I ran:
# ./configure --prefix=/usr --enable-unicode -with-ODBC=unixODBC
When configure runs, it finds the unixODBC headers okay.
Am I missing something else?
Regards
Lennart