Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar) - Mailing list pgsql-jdbc

From Sergey Kim
Subject Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)
Date
Msg-id DM2PR0201MB06879F1541795D1641DE23FCA5870@DM2PR0201MB0687.namprd02.prod.outlook.com
Whole thread Raw
In response to [JDBC] Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)  (Brad DeJong <Brad.Dejong@infor.com>)
Responses Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)  (Brad DeJong <Brad.Dejong@infor.com>)
List pgsql-jdbc

Dear Brad DeJong,


in stdlog we see messages:

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.

pgsql-jdbc by date:

Previous
From: Brad DeJong
Date:
Subject: Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)
Next
From: Brad DeJong
Date:
Subject: Re: logging bug in JDBC driver(https://jdbc.postgresql.org/download/postgresql-9.4.1212.jar)