added entlib logging and exception handling blocks.

added entlib logging and exception handling blocks.