Questions tagged [log4jdbc]

log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.

39 questions
16
votes
1 answer

How to log JDBC connection activity?

How can I see when my pooling library (C3P0) is creating and closing JDBC connections? Note: I have done research on this and already found a solution. I'm posting it here so that it may be useful to others and I can refer back to it in case I…
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169
4
votes
0 answers

Is there a log4jdbc-log4j2 alternative that is maintained?

The log4jdbc-log4j2 library seems to be not supported anymore. The last release was in 2013. However there is a bug in the library and I need an alternative (or a bugfix). I've googled for some alternatives but I didn't find one. Do you know any…
mvieghofer
  • 2,846
  • 4
  • 22
  • 51
4
votes
0 answers

Cannot get log4jdbc running properly on my MySQL

I am trying to run log4jdbc on my Hibernate/MySQL to return sql with execution time with following settings: Database…
Ye Huang
  • 639
  • 2
  • 10
  • 21
3
votes
3 answers

Can log4jdbc be used with spring boot?

I have a Spring boot app I'm trying to add database logging to which is better than spring.jpa.properties.hibernate.show_sql=true log4jdbc, from https://github.com/marcosemiao/log4jdbc seems to be the most up to date fork around, seems to format…
Ian
  • 1,507
  • 3
  • 21
  • 36
3
votes
0 answers

In log4j, can the level of a child logger be higher than the root logger's priority value?

Can the level of a child logger be higher than the root logger's priority value? My configuration is like below. Currently the package net.sf.log4jdbc still prints info level logs. I didn't intend any line of unimportant net.sf.log4jdbc logs to be…
hotohoto
  • 490
  • 8
  • 20
3
votes
2 answers

How to configure p6spy to redirect its output into a file

I was able to successfully configure P6Spy to intercept the JDBC calls and output them to Eclipse's console. However, I'd like to have those logs with the binding parameters captured in the file. Could someone please give me a hand on how to to…
Simeon Leyzerzon
  • 18,658
  • 9
  • 54
  • 82
3
votes
1 answer

log4jdbc not writing to log files

I am trying to debug connection leak in my Struts application and have set-up log4jdbc. I am able to see log4jdbc logs in console but I wish to have jdbc connection open/close events being written to a log file. Below is my log4j.properties file …
Ravi Gupta
  • 4,468
  • 12
  • 54
  • 85
3
votes
3 answers

How to log SQL with log4jdbc?

In a 2.0 Playframework project, I would like to analyze issued SQL queries by Slick. I am using log4jdbc for that but I can't get it to work. I have added the log4jdbc.jar file in lib/ folder and changed my application.conf file to following…
i.am.michiel
  • 10,281
  • 7
  • 50
  • 86
2
votes
1 answer

log4jdbc Java 8 compatibility

I'm trying to monitor my MySQL database queries using log4jdbc. I have a WSO2 Identity server running with Java 8. I followed the instructions in [1] and getting the following error. [2019-01-11 15:19:37,590] ERROR…
Vimbuddy
  • 166
  • 3
  • 19
2
votes
4 answers

Log4j2 markers in Logback

I'd like to use log4jdbc-log4j2 to log JDBC calls. The documentation providers information how to use it with Log4j2 markers.
devmake
  • 5,222
  • 2
  • 28
  • 26
2
votes
1 answer

get PreparedStatement query from Derby

I'm trying to connect to a database, run a query and print out the query. So far what I have works but I need to get the output and assign a particular part of it to a String public static void main(String args[]) { …
Hooli
  • 1,135
  • 3
  • 19
  • 46
2
votes
0 answers

log4j custom jdbc appender with spring dependency injected datasource

I am trying to add custom appender by extending JDBC appender to store my log data in to database. But i need to override the database connection from spring injected dataSource. Its not working for me because log4j context is loading first and…
2
votes
1 answer

Jboss 7 log4j configuration - JDBCAppender

Need help to setup Log4j JDBCAppender in standalone.xml in JBoss 7.1.1 I have tried as below but not working .... .... ....
Avil
  • 453
  • 3
  • 15
2
votes
1 answer

What are the format characters using in log4j and explain their usage and give me some example?

I have the below entry in the log4j config xml. What is the significant of '%p', '%C;%L', '%m'. What is stands for those characters? What other characters, we can use in log4j? Explain their usage..
Karthikeyan Sukkoor
  • 968
  • 2
  • 6
  • 24
1
vote
2 answers

log4j2: Is there any way to display sql values in log4j2?

Right now my info logs only show sql queries with ? for values. Can you suggest me changes to log4j2.xml file to display values? log4j2.xml: %-5p:%d{dd-MMM-yyyy…
EManual
  • 331
  • 4
  • 10
1
2 3