This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all! i have placed the classes111 and classes12.jar files in web-inf/lib folder and used a servlet which reads this properties file and log the statement to database.i am not able to log the statements in to the database ....i have use the following properties file: log4j.appender.R=org.apache.log4j.jdbc.JDBCAppender log4j.rootLogger=debug, R log4j.appender.R.Driver=oracle.jdbc.driver.OracleDriver log4j.appender.R.URL = jdbc racle:email@example.com:1521:itsr log4j.appender.R.user=hpabopa1 log4j.appender.R.password=hpa log4j.appender.R.sql=INSERT INTO jdbctest(message) VALUES ('%d - %c - %p - %m') # # These defines the layout to be used. # log4j.appender.R.layout=org.apache.log4j.PatternLayout can anyonle please help me....
what is the error / you dont see anything at all?. log4j.properties is located in the web-inf/classes folder?
Joined: Mar 06, 2001
Why dont u write a simple test.jsp that retreives the logger and just prints something to the table. Yes log4j.jar and classes12.zip s'd be in web-inf/lib folder Put log4j.properties in web-inf/classes folder. Just invoke the testjsp. If you are using tomcat and if something is wrong you s'd see an error displayed on tomcat console. We might be able to help after taking a look at the error.
I'm trying the same thing, here is what I have thus far, the code, exceptions, etc. Using: Tomcat: v4.1.29; log4j v1.2.7 log4j.properties
I get the collowing exception when Tomcat starts up:
Joined: Mar 06, 2001
Originally posted by David Yutzy: I'm trying the same thing, here is what I have thus far, the code, exceptions, etc.
And you have the jar file that contains the driver class in web-inf/lib folder? I guess you must be having log4j.jar there alogn with other required libraries. (I dont know the SQL Server database driver name)
tumbleweed and gunslinger
Joined: Jun 29, 2001
Yes, I can use SQL Server in the web application just fine. One thing I notice is that it appears to be loading the log4j settings during the Tomcat start-up rather than the WebApp start-up process. When I set Log4J to debug to the console, I usually get the Tomcat stuff scroll by, then it loads the webapp stuff, showing it in debug mode. When I change it to the DB version of log4j.properties, I see about 3 lines of Tomcat, then the exception I previously posted, then it loads the webapp. I wonder if I placed the DB .jar driver files in the Tomcat/lib if that would make a difference?
hi all, i m tryng to use log4j to insert the data into database. i want to insert the SQLs into the database so that we can check them in case of any error. can anyone pl. tell me how to go about it. i m new to log4j, so need help. pl. mail me at firstname.lastname@example.org thnx Rahul N B
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com