log4j:ERROR Attempted to append to closed appender named [null].
The following fix gives solution: java.sql.DriverManager.setLogWriter(new java.io.PrintWriter(System.out));
But it is related to the code modification routines.
What should be do in order to preserve the code untouched and still have to JDBC logging available? We just replaced the driver.
Best Regards, Sergey Kim
From: Brad DeJong <Brad.Dejong@infor.com> Sent: Friday, December 9, 2016 4:17:44 PM To: Sergey Kim; pgsql-jdbc@postgresql.org Cc: Sergey Onuchin Subject: RE: logging bug in JDBC driver (https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)
Sergey Kim wrote:
> ... (loglevel) parameter doesn't produce any messages ...
Please verify that your application calls java.sql.DriverManager.setLogWriter(PrintWriter) to set the log destination.
I just tested loglevel in PostgreSQL JDBC Driver 42.0.0.SNAPSHOT and including loglevel=2 in the JDBC connection string sets the loglevel correctly but the driver will only log messages if there is a valid LogWriter.