From 70b95e441017c1cc89c106c7167da2ef99da8748 Mon Sep 17 00:00:00 2001 From: Shane Daniel Date: Thu, 23 Aug 2018 14:00:31 -0400 Subject: Added logging of caught exceptions Issue-ID: LOG-629 Change-Id: I25cf2a5bc3423bd27f94780e60087452c521d9fe Signed-off-by: Shane Daniel --- .../contextbuilder/networkdiscovery/service/SpringServiceImpl.java | 3 +++ .../contextbuilder/networkdiscovery/service/rs/RestServiceImpl.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java index d73cfa6..89b07f8 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java +++ b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/SpringServiceImpl.java @@ -220,6 +220,7 @@ public class SpringServiceImpl implements SpringService { // If, for some reason we are unable to get the canonical host name, // we // just want to leave the field null. + log.info("Could not get canonical host name for " + MDC_SERVER_FQDN + ", leaving field null"); } } @@ -577,6 +578,7 @@ public class SpringServiceImpl implements SpringService { // If, for some reason we are unable to get the canonical host name, // we // just want to leave the field null. + log.info("Could not get canonical host name for " + MDC_SERVER_FQDN + ", leaving field null"); } } @@ -599,6 +601,7 @@ public class SpringServiceImpl implements SpringService { // If, for some reason we are unable to get the canonical host name, // we // just want to leave the field null. + log.info("Could not get canonical host name for " + MDC_SERVER_FQDN + ", leaving field null"); } } diff --git a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/rs/RestServiceImpl.java b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/rs/RestServiceImpl.java index 6f1a8c9..87ef440 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/rs/RestServiceImpl.java +++ b/src/main/java/org/onap/pomba/contextbuilder/networkdiscovery/service/rs/RestServiceImpl.java @@ -67,7 +67,7 @@ public class RestServiceImpl implements RestService { return Response.ok().entity(gson.toJson(sdContext)).build(); } } catch (DiscoveryException x) { - log.error(ErrorMessage.CONTEXT_BUILDER_FAILED); + log.error(ErrorMessage.CONTEXT_BUILDER_FAILED, x); return Response.status(x.getHttpStatus()).entity(x.getMessage()).build(); } catch (Exception x) { -- cgit 1.2.3-korg