I am using jdbcdslog with log4j logging engine in a webapp. I am able to log SQL queries that are executed. I want to know how to get the name of the package from which the query was fired. So that I can separate out the Log information, and know where a query cam from just by looking at the log, rather than going through the code.
I tried to use the %C parameter in PatternLayout of Log4j to get the package name as mentioned here
But the output I get is
2013-07-30-main--INFO -org.jdbcdslog.StatementLogger:java.sql.Statement.executeQuery: SELECT id, first, last, age FROM Employees;As you can see, the SQL query is logged, but the class it gave out is org.jdbcdslog.StatementLogger. Which is not what is desired, Since I want the name of the class the query was fired from.
I am using the following setting in Log4j.properties file
log4j.appender.S.layout.ConversionPattern=%d{yyyy-MM-dd}-%t-%x-%-5p-%C:%m%nAs jdbcdslog wraps the connection to the JDBC driver, I am not able to get what I really want.
I want to know how to get the name of the class where the query was fired from.
Any help is very much appreciated.
Thank you.
--
You received this message because you are subscribed to the Google Groups "jdbcdslog-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jdbcdslog-disc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.