Logging

Suave ships a small Suave.Logger helper for diagnostic output. Library messaging is intentionally light; for production telemetry most apps forward logs to their preferred backend.

Built-in Logger

open Suave
open Suave.Globals

Logger.info "Server starting"
// Logger.debug is only emitted when the DEBUG conditional is defined

Application logging

Prefer structured logging from your own code (Serilog, Microsoft.Extensions.Logging, Logary, etc.) at the WebPart boundary:

open Suave
open Suave.Globals
open Suave.Operators

let logged path next : WebPart =
  context (fun ctx ->
    Logger.info (sprintf "%s %s" ctx.request.rawMethod path)
    next)

Error handler

Configure SuaveConfig.errorHandler to log unhandled exceptions and return a safe response to clients. See Bindings & configuration.

Older Suave versions exposed a pluggable logger on config wired to Logary adapters. Current Suave focuses on the simple Logger helpers plus your application’s logging stack. If you migrate from v1/v2 Logary samples, adapt them to write from WebParts or errorHandler rather than copying obsolete config fields.