From a6ff0348e663d2b042f7c6dcfcbe45578711a271 Mon Sep 17 00:00:00 2001 From: Nigel Small Date: Fri, 13 Apr 2018 17:17:58 +0100 Subject: [PATCH] Move logging for Driver creation --- .../java/org/neo4j/driver/internal/DriverFactory.java | 10 ++++++++-- .../java/org/neo4j/driver/internal/InternalDriver.java | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java b/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java index 7f0a2d533d..3283a21327 100644 --- a/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java +++ b/driver/src/main/java/org/neo4j/driver/internal/DriverFactory.java @@ -158,7 +158,10 @@ protected InternalDriver createDirectDriver( SecurityPlan securityPlan, BoltServ { ConnectionProvider connectionProvider = new DirectConnectionProvider( address, connectionPool ); SessionFactory sessionFactory = createSessionFactory( connectionProvider, retryLogic, config ); - return createDriver( securityPlan, sessionFactory, metrics, config ); + InternalDriver driver = createDriver(securityPlan, sessionFactory, metrics, config); + Logger log = config.logging().getLog( Driver.class.getSimpleName() ); + log.info( "Direct driver instance %s created for server address %s", driver, address.toString() ); + return driver; } /** @@ -176,7 +179,10 @@ protected InternalDriver createRoutingDriver( SecurityPlan securityPlan, BoltSer ConnectionProvider connectionProvider = createLoadBalancer( address, connectionPool, eventExecutorGroup, config, routingSettings ); SessionFactory sessionFactory = createSessionFactory( connectionProvider, retryLogic, config ); - return createDriver( securityPlan, sessionFactory, metrics, config ); + InternalDriver driver = createDriver(securityPlan, sessionFactory, metrics, config); + Logger log = config.logging().getLog( Driver.class.getSimpleName() ); + log.info( "Routing driver instance %s created for server address %s", driver, address.toString() ); + return driver; } /** diff --git a/driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java b/driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java index 3378ab3531..3e0cc92de0 100644 --- a/driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java +++ b/driver/src/main/java/org/neo4j/driver/internal/InternalDriver.java @@ -47,7 +47,6 @@ public class InternalDriver implements Driver this.sessionFactory = sessionFactory; this.metrics = metrics; this.log = logging.getLog( Driver.class.getSimpleName() ); - log.info( "Driver instance %s created", this ); } @Override