Permalink
1 comment
on commit
Please
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix:Do not set the loglevel when instantiating a connection it is set…
… when the Driver starts
- Loading branch information
Showing
with
0 additions
and 19 deletions.
@@ -127,19 +127,12 @@ protected AbstractJdbc2Connection(HostSpec[] hostSpecs, String user, String data | ||
// standard out if no other printwriter is set | ||
|
||
int logLevel = Driver.getLogLevel(); | ||
Integer connectionLogLevel = PGProperty.LOG_LEVEL.getInteger(info); | ||
This comment has been minimized.
This comment has been minimized.
davecramer
Author
Member
|
||
if (connectionLogLevel != null) { | ||
logLevel = connectionLogLevel; | ||
} | ||
|
||
synchronized (AbstractJdbc2Connection.class) { | ||
logger = new Logger(nextConnectionID++); | ||
logger.setLogLevel(logLevel); | ||
} | ||
|
||
if (logLevel > 0) | ||
enableDriverManagerLogging(); | ||
This comment has been minimized.
whitingjr
Contributor
|
||
|
||
setDefaultFetchSize(PGProperty.DEFAULT_ROW_FETCH_SIZE.getInt(info)); | ||
|
||
prepareThreshold = PGProperty.PREPARE_THRESHOLD.getInt(info); | ||
@@ -272,7 +265,6 @@ else if (stringType.equalsIgnoreCase("varchar")) | ||
|
||
if (PGProperty.LOG_UNCLOSED_CONNECTIONS.getBoolean(info)) { | ||
openStackTrace = new Throwable("Connection was created at this point:"); | ||
enableDriverManagerLogging(); | ||
} | ||
this.disableColumnSanitiser = PGProperty.DISABLE_COLUMN_SANITISER.getBoolean(info); | ||
statementCache = new LruCache<Object, CachedQuery>( | ||
@@ -1285,17 +1277,6 @@ public Logger getLogger() | ||
} | ||
|
||
|
||
//Because the get/setLogStream methods are deprecated in JDBC2 | ||
//we use the get/setLogWriter methods here for JDBC2 by overriding | ||
//the base version of this method | ||
protected void enableDriverManagerLogging() | ||
{ | ||
if (DriverManager.getLogWriter() == null) | ||
{ | ||
DriverManager.setLogWriter(new PrintWriter(System.out, true)); | ||
} | ||
} | ||
|
||
public int getProtocolVersion() | ||
{ | ||
return protoConnection.getProtocolVersion(); | ||
1 comment
on commit 84b28eb
This comment has been minimized.
This comment has been minimized.
Interesting catch-22 it caused debugging to be turned off when not using a DataSource |
Removing this line causes all debug logging to be turned off when using a DataSource. This makes low level debugging far more difficult.
What is being fixed by this line being removed ?