Kind: Service
Source: Pams/API/Pams.API/Pams.API.csproj (line 1)
Part of: Pams
NuGet package dependency
Serilog.Formatting.Compact is a NuGet package dependency that formats Serilog log events as compact JSON. Pams.API can use its output for structured logs that downstream tools or scripts can parse.
Diagram
mermaidflowchart TD Api[Pams.API] --> Logger[Serilog logger] Logger --> Formatter[Serilog.Formatting.Compact] Formatter --> Output[Compact JSON log output] Output --> Consumer[Log consumer]
Usage
javascript// Read a compact JSON log event emitted by Pams.API.
const compactLogLine =
'{"@t":"2024-01-01T00:00:00.0000000Z","@mt":"Request completed","StatusCode":200}';
const logEvent = JSON.parse(compactLogLine);
console.log(logEvent["@t"]);
console.log(logEvent["@mt"]);
console.log(logEvent.StatusCode);
AI Coding Instructions
- Keep
Serilog.Formatting.Compactconfiguration in the API logging setup rather than formatting log events manually. - Preserve compact JSON property names such as
@tand@mtwhen building log consumers. - Treat each log line as an independent JSON object when reading file or console output.
- Avoid changing log formatting without checking integrations that parse
Pams.APIlog output.
Used by
1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Injected or called by (1)
Pams.API—Pams/API/Pams.API/Pams.API.csproj:1
Was this page helpful?