--- /dev/null
+.stack-work/
+cabal.sandbox.config
+.cabal-sandbox/
+
+dist/
+
+*.hi
+*.o
+
+*.swp
+
+.DS_Store
--- /dev/null
+Copyright (c) 2016 Andrew Rademacher
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
--- /dev/null
+graylog:
+ docker run -t -p 9000:9000 -p 12201:12201 -p 12201:12201/udp graylog2/allinone
--- /dev/null
+import Distribution.Simple
+main = defaultMain
--- /dev/null
+name: graylog
+version: 0.1.0.0
+synopsis: Support for graylog output.
+description: Please see README.md
+homepage: http://github.com/githubuser/graylog#readme
+license: MIT
+license-file: LICENSE
+author: Andrew Rademacher
+maintainer: andrewrademacher@gmail.com
+copyright: 2016 Andrew Rademacher
+category: Web
+build-type: Simple
+cabal-version: >=1.10
+
+library
+ hs-source-dirs: src
+ default-language: Haskell2010
+
+ exposed-modules: Graylog.Gelf
+
+ ghc-options: -Wall -rtsopts
+
+ build-depends: base ==4.*
+
+ , aeson
+ , aeson-casing
+ , scientific
+ , text
+ , time
+ , vector
--- /dev/null
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE OverloadedStrings #-}
+
+module Graylog.Gelf where
+
+import Data.Aeson (ToJSON (..), Value (..), genericToJSON,
+ toJSON)
+import Data.Aeson.Casing
+import Data.Scientific
+import Data.Text (Text)
+import Data.Time
+import Data.Typeable
+import Data.Vector
+import GHC.Generics
+
+data GELF
+ = GELF
+ { _gelfVersion :: Version
+ , _gelfHost :: Text
+ , _gelfShortMessage :: Text
+ , _gelfFullMessage :: Maybe Text
+ , _gelfTimestamp :: Maybe UTCTime
+ , _gelfLevel :: Maybe SyslogLevel
+ , _gelfLine :: Maybe Word
+ , _gelfFile :: Maybe Text
+ , _gelfAdditionalFields :: Vector Field
+ }
+ deriving (Show, Typeable, Generic)
+
+instance ToJSON GELF where
+ toJSON = genericToJSON $ aesonPrefix snakeCase
+
+--
+
+data Version
+ = Version1x1
+ deriving (Eq, Show, Typeable, Generic)
+
+instance ToJSON Version where
+ toJSON Version1x1 = String "1.1"
+
+--
+
+data SyslogLevel
+ = Emergency
+ | Alert
+ | Critical
+ | Error
+ | Warning
+ | Notice
+ | Informational
+ | Debug
+ deriving (Eq, Ord, Show, Typeable, Generic)
+
+instance ToJSON SyslogLevel where
+ toJSON Emergency = Number 0
+ toJSON Alert = Number 1
+ toJSON Critical = Number 2
+ toJSON Error = Number 3
+ toJSON Warning = Number 4
+ toJSON Notice = Number 5
+ toJSON Informational = Number 6
+ toJSON Debug = Number 7
+
+--
+
+data Field
+ = FieldString Text
+ | FieldNumber Scientific
+ deriving (Eq, Show, Typeable, Generic)
+
+instance ToJSON Field where
+ toJSON (FieldString s) = String s
+ toJSON (FieldNumber n) = Number n
+
--- /dev/null
+# This file was automatically generated by stack init
+# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/
+
+# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
+resolver: lts-5.4
+
+# Local packages, usually specified by relative directory name
+packages:
+- '.'
+# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
+extra-deps: []
+
+# Override default flag values for local packages and extra-deps
+flags: {}
+
+# Extra package databases containing global packages
+extra-package-dbs: []
+
+# Control whether we use the GHC we find on the path
+# system-ghc: true
+
+# Require a specific version of stack, using version ranges
+# require-stack-version: -any # Default
+# require-stack-version: >= 1.0.0
+
+# Override the architecture used by stack, especially useful on Windows
+# arch: i386
+# arch: x86_64
+
+# Extra directories used by stack for building
+# extra-include-dirs: [/path/to/dir]
+# extra-lib-dirs: [/path/to/dir]
+
+# Allow a newer minor version of GHC than the snapshot specifies
+# compiler-check: newer-minor