nri-observability-0.1.0.2: Report log spans collected by nri-prelude.
Safe HaskellNone
LanguageHaskell2010

Reporter.File

Description

Reporting to a file.

This reporter logs debugging information about completed requests to a file or stdout (in that case, pass in `devstdout` as the file to log to).

Every line this reporter logs is a JSON string. This 'structured logging' output is optimized for external logging platforms that display these logs in a pretty UI.

This logger supports sampling of successful requests, to help save money when sending logs to external services.

Synopsis

Documentation

handler :: Settings -> IO Handler Source #

Create a Handler for a specified set of Settings. Do this once when your application starts and reuse the Handler you get.

data Settings Source #

Configuration settings for this reporter. A value of this type can be read from the environment using the decoder function.

decoder :: Decoder Settings Source #

Read Settings from environment variables. Default variables will be used in case no environment variable is set for an option.

logFile :: Settings -> FilePath Source #

The file to log too. On unix systems you can set this to devstdout in order to log to stdout.

environment variable
LOG_FILE
default value
app.log

appName :: Settings -> Text Source #

The name of this application. This will be attached to all logs.

environment variable
LOG_ROOT_NAMESPACE
default value
your-application-name-here

appEnvironment :: Settings -> Text Source #

The environment this application is running in. This will be attached to all logs.

environment variable
ENVIRONMENT
default value
development

fractionOfSuccessRequestsLogged :: Settings -> Float Source #

The fraction of requests that should be logged. Set to 1 if you want to log everything, and a lower value to save money.

environment variable
FRACTION_OF_SUCCESS_REQUESTS_LOGGED
default value
1