DDF-880 Review/refactor all error logging.

Probably the main thing to watch out for here is any inadvertent double-logging. There shouldn't be any functional issues.
I wasn’t familiar with Xlogger, that’s a good idea.

From: Matt Ramey <notifications@github.com<mailto:notifications@github.com>>
Reply-To: codice/ddf-catalog <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Tuesday, November 18, 2014 at 11:30 AM
To: codice/ddf-catalog <ddf-catalog@noreply.github.com<mailto:ddf-catalog@noreply.github.com>>
Cc: localadmin <brendan.hofmann@connexta.com<mailto:brendan.hofmann@connexta.com>>
Subject: Re: [ddf-catalog] DDF-880 Review/refactor all error logging. (#36)


In core/catalog-core-standardframework/src/main/java/ddf/catalog/impl/CatalogFrameworkImpl.java:

> @@ -733,8 +736,10 @@ public SourceInfoResponse getFanoutSourceInfo(SourceInfoRequest sourceInfoReques
>
>      private void validateSourceInfoRequest(SourceInfoRequest sourceInfoRequest) {
>          if (sourceInfoRequest == null) {
> -            logger.error("Received null sourceInfoRequest");
> -            throw new IllegalArgumentException("SourceInfoRequest was null");
> +            IllegalArgumentException illegalArgumentException = new IllegalArgumentException(
> +                    "SourceInfoRequest was null");
> +            logger.error("Received null sourceInfoRequest", illegalArgumentException);


I'm not the biggest fan of XLogger these days, but since it's already being used you can also do:

logger.throwing(illegalArgumentException)

for many of these logs where you're just logging the exception and are putting in generic messages to fulfill the method. Might want to look at how it formats the log though to see if it's any better/more readable.

Reference:
http://www.slf4j.org/api/org/slf4j/ext/XLogger.html#throwing(T)
http://www.slf4j.org/api/org/slf4j/ext/XLogger.html#throwing(org.slf4j.ext.XLogger.Level, T)

—
Reply to this email directly or view it on GitHub<https://github.com/codice/ddf-catalog/pull/36/files#r20526249>.