logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lennart Goedhart" <lenn...@omnibase.com.au>
Subject Re: ODBCAppender on Linux
Date Thu, 20 May 2004 02:11:40 GMT
I am logging against the .so as far as I know...
To make things easy on myself, I stripped the project right down to this:
Test.cpp:
------------------------------------------------------------
#include <log4cxx/logger.h>
#include <log4cxx/propertyconfigurator.h>

using namespace log4cxx;

int main(int argc, char* argv[])
{
    LoggerPtr logger = Logger::getLogger( "main" );
    PropertyConfigurator::configure( "logging.cfg" );
    logger->info( "Testing the log4cxx stuff" );

    return 0;
}
------------------------------------------------------------

Again, using the logging.cfg file below, it ran fine on Windows, same error
on Linux, with Linux still writing okay to the RollingFileAppender.
Here is the command line I used to compile it under Linux:
# g++ -o Test Test.cpp -llog4cxx

----- Original Message ----- 
From: "Pete Rowley" <pete@openrowley.com>
To: "Log4CXX User" <log4cxx-user@logging.apache.org>
Sent: Wednesday, May 19, 2004 10:08 AM
Subject: Re: ODBCAppender on Linux


> I had something similar recently - turned out I goofed by linking against
> the .a, linking against the .la or the .so fixed the problem.
>
> ----- Original Message ----- 
> From: "Lennart Goedhart" <lennart@omnibase.com.au>
> To: <log4cxx-user@logging.apache.org>
> Sent: Tuesday, May 18, 2004 4:52 PM
> Subject: ODBCAppender on Linux
>
>
> > 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
> >
> >
>


Mime
View raw message