greg-client-1.0.2: A scalable distributed logger with a high-precision global time axis.

PortabilityGHC only (STM, GHC.Conc for unsafeIOToSTM)
MaintainerEugene Kirpichov <>, Dmitry Astapov <>



This module provides a binding to the greg distributed logger, which provides a high-precision global time axis and is very performant.

See project home page at for an explanation of how to use the server, the features, motivation and design.



data Configuration Source

Client configuration. You probably only need to change server.




server :: String

Server hostname (default localhost)

port :: Int

Message port (default 5676)

calibrationPort :: Int

Calibration port (default 5677)

flushPeriodMs :: Int

How often to send message batches to server (default 1000)

clientId :: String

Arbitrary identifier, will show up in logs. For example, "DataService" (default "unknown")

maxBufferedRecords :: Int

How many records to store between flushes (more will be dropped) (default 100000)

useCompression :: Bool

Whether to use gzip compression (default False, True is unsupported)

calibrationPeriodSec :: Int

How often to initiate calibration exchanges (default 10)

logMessage :: String -> IO ()Source

Log a message. The message will show up in server's output annotated with a global timestamp (client's clock offset does not matter).

withGregDo :: Configuration -> IO () -> IO ()Source

Perform an IO action with logging (will wait for all messages to flush).

defaultConfiguration :: ConfigurationSource

The default configuration, suitable for most needs.