Skip to content

Serilog.Sinks.File

reference
1 min readUpdated

Kind: Service

Source: Pams/API/Pams.API/Pams.API.csproj (line 1)

Part of: Pams

NuGet package dependency

Serilog.Sinks.File is a NuGet package dependency declared by Pams.API.csproj. It enables the Pams API to write Serilog log events to file-backed sinks configured by the .NET application.

Diagram

mermaid
sequenceDiagram
    participant Client
    participant API as Pams API
    participant Logger as Serilog
    participant FileSink as Serilog File Sink

    Client->>API: Send request
    API->>Logger: Write log event
    Logger->>FileSink: Persist event to log file

Usage

ts
const response = await fetch("/api/pams", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    action: "create",
  }),
});

if (!response.ok) {
  throw new Error("Pams API request failed");
}

// Request handling is logged by the API through Serilog.Sinks.File.

AI Coding Instructions

  • Keep the Serilog.Sinks.File package reference in Pams.API.csproj.
  • Configure file sink settings in the API's Serilog configuration rather than from client code.
  • Do not import this NuGet package from TypeScript or JavaScript; it runs within the .NET API process.
  • Check that the API process has write access to the configured log file path.

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.APIPams/API/Pams.API/Pams.API.csproj:1

Was this page helpful?

Download as PDF