Kevin,

I just rebuilt the 1.2rc1 and I don't find a jdbc package...  Is that
package
only in a nightly build release?

Mark

-----Original Message-----
From: Kevin Steppe [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 4:19 PM
To: Log4J Users List
Subject: Re: JDBCAppender in 1.2rc1


Ceki, could you yank my directory from the contribs as it is now completely
outdated?

Mark,

Looks like you are compiling from the contribs/ folder.  DONT use the
JDBCAppender there.  Use the appender in org/apache/log4j/jdbc

The example program there (JDBCTest.java) won't work with the new appender,
as
the example program uses log4j1.1 style configuration -- convert all the
setOption(...) calls to setXYZ(...) and it should work fine.  For my testing
I
removed all config stuff and just called PropertyConfigurator.  Lines 22
through
~ 40 then become:

...
     Logger rootLog = Logger.getRootLogger();
//        Layout layout = new PatternLayout("%p [%t] %c - %m");
        JDBCAppender appender = new JDBCAppender();
//        appender.setLayout(layout);
//        appender.setSql("insert into Logs (Level, Thread, Class, Message,
Time) values ('%p', '%t', '%c', '%m', '%d')");
//        appender.setURL("jdbc:odbc:someDB");
//        appender.setUser("auser");
//        appender.setPassword("thepassword");
        PropertyConfigurator.configure("c:\\java\\jdbcprops.txt");
//        rootLog.addAppender(appender);
        appender = (JDBCAppender)rootLog.getAppender("jdbc");

        try {
            Logger log = Logger.getLogger("main");
            log.debug("Debug 1");
            Thread.sleep(500);
            log.info("info 1");
...

That should work much better.  I've posted an example properties file to the
list several times, look for "myDB and Kevin" in the logs.

Kevin




"McDowell, Mark" wrote:

> I'm trying to compile the demo program for the Kevin Steppe JDBCAppender,
> and it won't compile.
>
> I get this message:
> JDBCAppender.java [111:1] cannot resolve symbol
> symbol  : method setOption  (java.lang.String,java.lang.String)
> location: class org.apache.log4j.AppenderSkeleton
>     super.setOption(key, value);
>          ^
> JDBCAppender.java [139:1] cannot resolve symbol
> symbol  : method getOptionStrings  ()
> location: class org.apache.log4j.AppenderSkeleton
>     return OptionConverter.concatanateArrays(super.getOptionStrings(),
>                                                   ^
> 2 errors
> Errors compiling JDBCAppender.java.
>
> Neither the Appender interface, nor the SkeletonAppender class, contain
> setOption or getOptionStrings...  What's the deal?  Am I doing something
> wrong?
>
> Mark McDowell
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to