Logo GenPRES

McpLogging Module

Composition-root logging for the stdio MCP host: one Serilog-backed logger for the whole session, gated by GENPRES_LOG exactly as the server's `loggingEnabled`/`loggingLevel` are (unset or blank => logging off => Logging.noOp). Duplicated rather than referenced from Informedica.GenPRES.Server, since Informedica.MCP.Lib/Informedica.MCP.Server are siblings to that project and must not reference it.

Nested modules

Modules Description

EventFormat

What a sink writes for a log event. Rendering happens here, on the sink's thread.

SerilogBridge

Turns a Serilog ILogger into the domain-facing Logger record. The whole Event crosses as one scalar property: the thread that logs stores a reference and enqueues, and the text is rendered by the sink's formatter on the sink's own thread. That is safe because an Event and every message under it is immutable. This is the server's bridge written a second time: only the two executables refer to Serilog, and neither refers to the other.

Functions and values

Function or value Description

buildLogger level

Full Usage: buildLogger level

Parameters:
Returns: Logger * string
level : Level
Returns: Logger * string

buildLoggerAt path level

Full Usage: buildLoggerAt path level

Parameters:
    path : string
    level : Level

Returns: Logger

The logger that writes to the file at `path`. Each sink sits behind its own queue and thread, so the thread that logs only enqueues. stdout is the JSON-RPC transport channel of a stdio MCP session, so the console sink writes every event to stderr, never stdout: `standardErrorFromLevel = Verbose` is below Debug, the lowest level there is.

path : string
level : Level
Returns: Logger

getLogger getEnv

Full Usage: getLogger getEnv

Parameters:
    getEnv : string -> string option

Returns: Logger * (unit -> unit)

Returns the `Logger` port value plus a disposer: `Program.fs`'s `main` calls the disposer after `McpServer.run` returns.

getEnv : string -> string option
Returns: Logger * (unit -> unit)

getRecommendedLogPath componentName

Full Usage: getRecommendedLogPath componentName

Parameters:
    componentName : string option

Returns: string
componentName : string option
Returns: string

parseLevel raw

Full Usage: parseLevel raw

Parameters:
    raw : string option

Returns: Level option
raw : string option
Returns: Level option

Type something to start searching.