diff --git a/hslogger.cabal b/hslogger.cabal
--- a/hslogger.cabal
+++ b/hslogger.cabal
@@ -1,5 +1,5 @@
 Name: hslogger
-Version: 1.2.6
+Version: 1.2.7
 License: BSD3
 Maintainer: John Goerzen <jgoerzen@complete.org>
 Author: John Goerzen
@@ -27,7 +27,7 @@
     testsrc/Tests.hs,
     testsrc/runtests.hs,
     winbuild.bat
-Cabal-Version: >= 1.2
+Cabal-Version: >= 1.6
 
 flag small_base
   description: choose the new smaller, split-up base package.
@@ -49,8 +49,8 @@
         build-depends: base >= 4 && < 5, containers, directory, process,
                        time < 1.5, old-locale
     else
-        build-depends: base < 3, time < 1.5
-    GHC-Options: -O2
+        build-depends: base < 3, time
+    -- GHC-Options: -O2
     Hs-Source-Dirs: src
 
 Executable runtests
@@ -62,3 +62,4 @@
     HS-Source-Dirs: testsrc, .
     Extensions: ExistentialQuantification, OverlappingInstances,
         UndecidableInstances, CPP
+
diff --git a/src/System/Log/Formatter.hs b/src/System/Log/Formatter.hs
--- a/src/System/Log/Formatter.hs
+++ b/src/System/Log/Formatter.hs
@@ -28,7 +28,11 @@
 import System.Posix.Process (getProcessID)
 #endif
 
+#if MIN_VERSION_time(1,5,0)
+import Data.Time.Format (defaultTimeLocale)
+#else
 import System.Locale (defaultTimeLocale)
+#endif
 import Data.Time (getZonedTime,getCurrentTime,formatTime)
 
 import System.Log
diff --git a/src/System/Log/Handler/Log4jXML.hs b/src/System/Log/Handler/Log4jXML.hs
--- a/src/System/Log/Handler/Log4jXML.hs
+++ b/src/System/Log/Handler/Log4jXML.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
 {- |
    Module     : System.Log.Handler.Log4jXML
    Copyright  : Copyright (C) 2007-2011 John Goerzen
@@ -109,7 +110,11 @@
 import Control.Concurrent.MVar
 import Data.List (isPrefixOf)
 import System.IO
+#if MIN_VERSION_time(1,5,0)
+import Data.Time.Format (defaultTimeLocale)
+#else
 import System.Locale (defaultTimeLocale)
+#endif
 import Data.Time
 import System.Log
 import System.Log.Handler
