Add exception handling feature

Non-static loggers will get serialized. Either make static or make transient and initialize in the prepare method.