Skip to content

PostgresServerLog

Namespace: Ankus.PgConfig

Assembly: Ankus.PgConfig.dll

Retains a server’s native stderr and isolated Windows event diagnostics across collection and process restarts.

public sealed class PostgresServerLog

Inheritance: object

Retains a server’s native stderr and isolated Windows event diagnostics across collection and process restarts.

public PostgresServerLog(string filePath, Guid identity)

Parameters:

filePath — string

The retained diagnostic file, outside the server’s data directory.

identity — Guid

The unique server identity supplied to PostgreSQL through the event_source setting.

Gets this server’s distinct provider name without registering a source or exposing machine identifiers.

public string EventSource { get; }

Value: string

Gets the native stderr target, separately from the retained Windows snapshot.

public string NativeFilePath { get; }

Value: string

Reads current native diagnostics and updates the retained snapshot without duplicating earlier events.

public string Read(CancellationToken cancellationToken = default)

Parameters:

cancellationToken — CancellationToken

Cancels collection or waiting for another collector’s cursor lock.

Returns: string

The native stderr and all retained events belonging to this identity.

Reads a live native log while preserving PostgreSQL’s writer and cleanup handles.

public static string ReadFile(string path)

Parameters:

path — string

The native file or retained snapshot to inspect.

Returns: string

The current text, or empty text for an absent file.