[handler] add docs and testing for the LoggingHandler.

This changeset adds tests and also reformats the LoggingHandler, adds some javadocs for clarity.