I'm attaching a txt file that contains the property file info you need for
the JDBCAppender (Kevin Steppe's) in log4j v.1.1.3.  When I was setting up
my JDBCAppender for the first time Kevin was very helpful (he's active in
this forum).  

Hope this gets you started.


-----Original Message-----
From: Doug Clifton [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 6:00 AM
To: Log4J Users List
Subject: Newbie question


Hi all,

  I have just learned about log4j and am evaluating changing some code
to make use of it.  I've gone thru all the docs I can find and can not
find any examples of how to set up the properties file when the appender
is either a syslog or jdbc destination.  I've intuited some of the jdbc
values, but I'm just unsure of what all is/can be done with it from the
properties file.  I'd like to use the jdbc to reach a mysql logging db
that I already have set up for other applications and IF the logging
machine can NOT be reached, I'd like to fail over to syslog on the
machine the application is running on (normally solaris,linux boxes). 
My primary concern would be syslog options and jdbc configuration setup
in the properties file for now. Any help/examples that someone could
direct me to would be greatly appreciated.  Thanks in advance.

 Doug

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

# Set root category priority to DEBUG and its appenders to be a JDBC Appender (jdbc)

log4j.rootCategory=DEBUG,jdbc



######## JDBC Appender settings ##########

 

# jdbc is set to be a JDBCAppender

# JDBCAppender writes messages into the database

log4j.appender.jdbc=org.apache.log4j.varia.JDBCAppender

 

# DB Options (URL, username, password, driver)

# Username and Password may not be needed for this DB

log4j.appender.jdbc.URL=jdbc:odbc:someODBC

log4j.appender.jdbc.user=

log4j.appender.jdbc.password=

# In this case, I'm using a JDBC-ODBC Bridge
log4j.appender.jdbc.driver=sun.jdbc.odbc.JdbcOdbcDriver

 

# SQL statement to be used (with multiple columns formatted)

log4j.appender.jdbc.sql=insert into someTable (message, class, priority, logdate) 
values ('%m', '(%F:%L)', '%p', '%d{ISO8601}')

 

# Set logging threshold (only messages of priority level WARN or higher will be logged 
to DB)
# This threshold setting is optional

log4j.appender.jdbc.threshold=WARN


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

Reply via email to