]> git.immae.eu Git - github/fretlink/haskell-graylog.git/blame - src/Graylog/UDP.hs
Defined sendLog function.
[github/fretlink/haskell-graylog.git] / src / Graylog / UDP.hs
CommitLineData
15981d57 1module Graylog.UDP
c91dbdc0 2 ( sendLog
15981d57 3
2ff46fce 4 , module Export
15981d57
A
5 ) where
6
c91dbdc0
A
7import Data.Aeson
8import qualified Data.ByteString.Lazy as LBS
9import Network.Socket.ByteString.Lazy
10import System.Random.MWC
11
12import Graylog.Gelf as Export
13import Graylog.Types as Export
15981d57
A
14
15sendLog :: Graylog -> GELF -> IO ()
c91dbdc0
A
16sendLog glog msg = mapM_ (send $ _graylogSocket glog) cks
17 where
18 raw = encode msg
19 cks = chunky raw
2ff46fce 20
c91dbdc0
A
21chunky :: LBS.ByteString -> [LBS.ByteString]
22chunky = undefined