You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "McDowell, Mark" <Mc...@ncs.com> on 2002/05/03 20:10:00 UTC
JDBCAppender in 1.2rc1
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: JDBCAppender in 1.2rc1
Posted by Kevin Steppe <ks...@pacbell.net>.
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: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>