Hey

I wanted to configure log4j to write logs to ms sql and I've got issue with
appender.
I've setup layout and add appender in log4j.properties As appender I've
used JDBCAppender

log4j.appender.DB=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.DB.URL=jdbc:sqlserver://_connection_string_here_
log4j.appender.DB.sql=_my_sql_

I've saved config and run pio app list and I've got exception:
log4j:ERROR Failed to excute sql
java.sql.SQLException: No suitable driver found for
jdbc:sqlserver://CL-STAND-4SQ02;databaseName=hawksearch;user=hawksearch-iis-123;password=ae9322i#!
        at java.sql.DriverManager.getConnection(DriverManager.java:596)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at
org.apache.log4j.jdbc.JDBCAppender.getConnection(JDBCAppender.java:251)
        at org.apache.log4j.jdbc.JDBCAppender.execute(JDBCAppender.java:215)
        at
org.apache.log4j.jdbc.JDBCAppender.flushBuffer(JDBCAppender.java:289)
        at org.apache.log4j.jdbc.JDBCAppender.append(JDBCAppender.java:186)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
        at org.apache.log4j.Category.callAppenders(Category.java:206)
        at org.apache.log4j.Category.forcedLog(Category.java:391)
        at org.apache.log4j.Category.log(Category.java:856)
        at org.slf4j.impl.Log4jLoggerAdapter.info
(Log4jLoggerAdapter.java:305)
        at grizzled.slf4j.Logger.info(slf4j.scala:128)
        at grizzled.slf4j.Logging$class.info(slf4j.scala:268)
        at io.prediction.tools.console.App$.info(App.scala:31)
        at io.prediction.tools.console.App$.list(App.scala:100)
        at
io.prediction.tools.console.Console$$anonfun$main$1.apply(Console.scala:741)
        at
io.prediction.tools.console.Console$$anonfun$main$1.apply(Console.scala:693)
        at scala.Option.map(Option.scala:145)
        at io.prediction.tools.console.Console$.main(Console.scala:693)
        at io.prediction.tools.console.Console.main(Console.scala)

I've downloaded driver from microsoft site
https://www.microsoft.com/en-us/download/details.aspx?id=2505 and put it in
predictionio/lib folder but this didn't help.
Can somebody help me configuring this ms sql appender to log4j.

Thanks
Regards Paweł Madurski




-- 
Pozdrawiam,
Paweł Madurski

Reply via email to