Skip to content

Commit

Permalink
[connection]调整加载驱动程序错误日志输出级别为ERROR,便于问题排查
Browse files Browse the repository at this point in the history
  • Loading branch information
datageartech committed May 7, 2020
1 parent 7b401b4 commit 6691294
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ protected Connection getPreferredConnection(ConnectionOption connectionOption)
Connection preferedConnection = getConnection(preferedDriver, connectionOption);

if (LOGGER.isDebugEnabled())
LOGGER.debug("Got prefered connection by cached [" + preferedDriverEntity + "] for ["
LOGGER.debug("Get prefered connection by cached [" + preferedDriverEntity + "] for ["
+ connectionOption + "]");

return preferedConnection;
}
else
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("Got null connection by cached no-prefered " + DriverEntity.class.getSimpleName()
LOGGER.debug("Get null connection by cached no-prefered " + DriverEntity.class.getSimpleName()
+ " for [" + connectionOption + "]");

throw new UnsupportedGetConnectionException(connectionOption);
Expand Down Expand Up @@ -228,9 +228,8 @@ protected Connection getPreferredConnection(ConnectionOption connectionOption)
}
else
{
if (LOGGER.isDebugEnabled())
LOGGER.debug(
"Getting connection with [" + driverEntity + "] for [" + connectionOption + "] error",
if (LOGGER.isErrorEnabled())
LOGGER.error("Get connection with [" + driverEntity + "] for [" + connectionOption + "] error",
e);
}
}
Expand Down Expand Up @@ -271,8 +270,8 @@ protected void findOrderedAcceptedAndCheckedDriverEntityDrivers(ConnectionOption
}
catch (Throwable t)
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("Getting Driver with [" + driverEntity + "] for getting prefered connection for ["
if (LOGGER.isErrorEnabled())
LOGGER.error("Get Driver with [" + driverEntity + "] for getting prefered connection for ["
+ connectionOption + "] error", t);
}

Expand All @@ -286,8 +285,8 @@ protected void findOrderedAcceptedAndCheckedDriverEntityDrivers(ConnectionOption
}
catch (Throwable t)
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("Checking if url accepted with [" + driverEntity
if (LOGGER.isErrorEnabled())
LOGGER.error("Check if url accepted with [" + driverEntity
+ "] for getting prefered connection for [" + connectionOption + "] error", t);
}

Expand All @@ -304,8 +303,8 @@ protected void findOrderedAcceptedAndCheckedDriverEntityDrivers(ConnectionOption
}
catch (Throwable t)
{
if (LOGGER.isDebugEnabled())
LOGGER.debug("checking if [" + driverEntity
if (LOGGER.isErrorEnabled())
LOGGER.error("Check if [" + driverEntity
+ "] 's driver checked for getting prefered connection for [" + connectionOption
+ "] error", t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ public synchronized Driver getDriver(String driverClassName) throws PathDriverFa

if (driver == null)
throw new PathDriverFactoryException(
"No Driver named [" + driverClassName + "] can be found in [" + this.path + "]");
"No Driver named [" + driverClassName + "] found in [" + this.path + "]");

if (LOGGER.isDebugEnabled())
LOGGER.debug("Got JDBC driver [" + driverClassName + "] in path [" + this.path + "]");
if (LOGGER.isInfoEnabled())
LOGGER.info("Get JDBC driver [" + driverClassName + "] in path [" + this.path + "]");

return driver;
}
Expand Down

0 comments on commit 6691294

Please sign in to comment.