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