37 questions
2
votes
2
answers
220
views
Log4j2 properties file JDBC appender - cast context variable to uuid
I have the following database table (PostgreSQL)
create table audit_read
(
level text,
account_id uuid,
message text
);
I want to insert a database record when a logging event occurs. I ...
0
votes
0
answers
1k
views
Is there a way to update log4j to latest version?
1.How can we update log4j from older versions to latest version
2.What needs to be changed in pom.xml
3.What artifacts needs to be updated
4.Which verison of log4j is stable
5.What is the source to ...
0
votes
1
answer
497
views
log4jdbc-log4j2-jdbc4 logging error ResultSet.isClosed
I am using log4j2, and I added "log4jdbc-log4j2-jdbc4" library to express the sql query statement log, but there is an error at runtime.
System Specifications:
jdk1.6
log4j2.3.2
slf4j-api 1....
1
vote
2
answers
2k
views
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:
<RollingRandomAccessFile name="SQLLOGFILE"&...
1
vote
0
answers
750
views
(log4jdbc + slf4j + logback) how to auto line sort sql log?
I installed Log4jdbc-log4j2 + slf4j + logback on my dynamic web server project.
During the test, the log and query statements come out as set, but like other people, the query statement does not wrap ...
2
votes
1
answer
1k
views
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:...
3
votes
3
answers
4k
views
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 ...
0
votes
1
answer
3k
views
Log4jdbc level configuration is not working
This is my logback.xml configuration
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<...
1
vote
1
answer
533
views
Getting syntax error (XML Config) in MySQL using Log4j2
I am currently working on my Spring project to create simple library portal (just for education purposes). And now I am struggling with logging some actions into MySQL database using Log4j2 ...
0
votes
1
answer
2k
views
Log4j RollingFileAppender unknown error
Error corresponding to log4j.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
log4j:WARN No such property [datePattern] in org.apache.log4j.RollingFileAppender.
...
0
votes
2
answers
548
views
Clojure REST API: Logging issue
I have figured out one issue with logging in clojure api.
I try to implement logging mechanism for API Requests and SQL statements.
Project.clj
(defproject clojure-dauble-business-api "0.1.0-...
0
votes
3
answers
408
views
ClassNotFound from shared library jar
I have developed an application which is used to log record into Database with log4j2.xml using JDBCAppender. I have followed the following instruction here :- http://self-learning-java-tutorial....
0
votes
1
answer
193
views
log4jdbc sql timing of both : executing PreparedStatement SELECT + retrieving whole result set
Is there an easy way to measure executiontime of a whole block ?
This is a closed code big Java WAR application so I think it is hard to introduce startTime/endTime blocks by some AOP.
// startTime
...
1
vote
1
answer
261
views
log4jdbc force return ConnectionSpy driver
For some reason when I use:
connection = DriverManager.getConnection("jdbc:log4jdbc:derby:/home/user/mydb");
I tend to get differing connections back. In this case, it's a mixture between:
...
2
votes
4
answers
6k
views
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.
<logger name="log4jdbc.log4j2" level="info" additivity="false">
&...
2
votes
1
answer
2k
views
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(...
1
vote
0
answers
301
views
Weblogic, log4j and log4jdbc, log in file but not in console
In Weblogic, using log4jdbc, I need to log queries (using org.jdbcdslog.StatementLogger) only in a specific file but not in console.
I tried to start Weblogic with this parameter
-Dlog4j....
3
votes
0
answers
286
views
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 ...
3
votes
2
answers
5k
views
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. ...
1
vote
1
answer
955
views
How do I remove the Tomcat INFO just from log file
How I can remove all my Tomcat INFO from my log file, but just from my log file, I want to see that INFO only in console output
1
vote
1
answer
2k
views
Configuring log4jdbc-log4j2 with Liberty Profile
I have a web application that is deployed locally to a Liberty Profile server, and that is already working with log4j2. My end goal is to log all of the PreparedStatements with their parameter values ...
3
votes
1
answer
695
views
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 ...
0
votes
1
answer
378
views
Capturing sql queries along with bind parameters into log files
I used p6spy/log4jdbc to capture the sql queries along with the bind parameters, connecting to Oracle database (hibernate 4.3.5 and oracle 10g is used) and push it to log files which are configured ...
5
votes
0
answers
890
views
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 ...
2
votes
0
answers
798
views
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 ...
0
votes
2
answers
1k
views
how to log hibernate parameters
I have project pf JPA. My logs looks like this:
Hibernate: insert into TEST(DESCRIPTION, NAME, version, id) values (?, ?, ?, ?)
[08/12/14 06:26:26:026 GET] TRACE sql.BasicBinder: binding parameter [1]...
1
vote
3
answers
11k
views
How to print Log4j java sql logger
I want to use log4j for java and sql. i want to print the java and sql logs without using "logger.debug("log4j logger")" in my class.
Below are the class and log4j properties used
package com.log4j;
...
1
vote
2
answers
179
views
Replacing log4j-api-2.0-beta9.jar,log4j-core-2.0-beta9 with log4j-api-2.0.1.jar and log4j-core-2.0.1.jar not working
I am trying to use the new log4j2 release in my application and it is not working. It was working when i used log4j-api-2.0-beta9.jar and log4j-core-2.0-beta9 but its not working after i replaced it ...
0
votes
1
answer
229
views
Logging traces over JDBC with log4j 1.x
We are using log4j 1.x as logging platform for quite some time now. Most of our applications are based on Spring Framework which also uses log4j 1.x. Now we wish to write logs in database and we know (...
2
votes
1
answer
1k
views
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
<subsystem xmlns="urn:jboss:domain:logging:1.1">
....
....
....
<custom-handler ...
4
votes
0
answers
2k
views
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 connection:
hibernate.dialect=org.hydra.webapp.util.MySQL5MyISAMDialect
...
0
votes
1
answer
382
views
log4j MDC's visibility is instance level? global level?
I am working in j2ee application. we are using session bean (20 instance). in that MDC used to log the message id for each request.
import org.apache.log4j.Logger;
import org.apache.log4j.MDC;
public ...
2
votes
1
answer
1k
views
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..
...
1
vote
0
answers
105
views
Java Exception Manager - Enterprise Level
I am looking for an industrial strength FOSS logger for an Enterprise Java application, before I embark on re-inventing the wheel...
We have all seen large apps that log exceptions (think SAPesque), ...
1
vote
1
answer
854
views
log4j(dbc) + Hibernate: filtering ONLY sql statments
Good evening everyone.
I'm using log4j with log4jdbc to log my application's Hibernate fw. I have this log4j.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration ...
16
votes
1
answer
28k
views
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 ...
3
votes
3
answers
4k
views
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 ...