diff --git a/hsyslog-udp.cabal b/hsyslog-udp.cabal
--- a/hsyslog-udp.cabal
+++ b/hsyslog-udp.cabal
@@ -1,5 +1,5 @@
 name:                   hsyslog-udp
-version:                0.2.0
+version:                0.2.1
 synopsis:               Log to syslog over a network via UDP
 description:            Supports <https://tools.ietf.org/html/rfc5424 RFC 5424>,
                         <https://tools.ietf.org/html/rfc3164 RFC 3164>, or any
@@ -8,8 +8,8 @@
 bug-reports:            https://github.com/ThoughtLeadr/hsyslog-udp/issues
 license:                BSD3
 license-file:           LICENSE
-author:                 Jon Childress
-maintainer:             jon@childr.es
+author:                 Jon Childress <jon@childr.es>
+maintainer:             Kostiantyn Rybnikov <konstantine@thoughtleadr.com>
 category:               System
 build-type:             Simple
 extra-source-files:     README.md
diff --git a/src/System/Posix/Syslog/UDP.hs b/src/System/Posix/Syslog/UDP.hs
--- a/src/System/Posix/Syslog/UDP.hs
+++ b/src/System/Posix/Syslog/UDP.hs
@@ -149,6 +149,7 @@
 initSyslog config = S.withSocketsDo $ do
     socket <- S.socket (S.addrFamily $ address config) S.Datagram udpProtoNum
     let send = flip (SB.sendTo socket) (S.addrAddress $ address config)
+        safely f = catch (void f) (onException config)
 
     return $ \facility severity message ->
       case maskedPriVal (severityMask config) facility severity of
@@ -186,6 +187,8 @@
   , protocol :: Protocol
     -- ^ protocol for formatting the message, such as 'rfc5424Protocol' or
     -- 'rfc3164Protocol'
+  , onException :: SomeException -> IO ()
+    -- ^ custom exception handler
   }
 
 -- | A convenient default config for connecting to 'localhost'. Provided for
@@ -201,6 +204,7 @@
     severityMask = [minBound..maxBound]
     address = localhost
     protocol = rfc3164Protocol
+    onException = const $ return ()
 
 -- | The default IPv4 address/port for syslog on a local machine. Provided for
 -- development/testing purposes.
@@ -409,9 +413,6 @@
   where
     mkHost (HostName x) = notEmpty x
     mkTag (AppName name) (ProcessID procId) = name <> "[" <> procId <> "]:"
-
-safely :: IO a -> IO ()
-safely f = catch (void f) (const $ return () :: SomeException -> IO ())
 
 sp :: ByteString -> ByteString -> ByteString
 sp b1 b2 = b1 <> " " <> b2
