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 PostgresServerLogInheritance: object
Constructors
Section titled “Constructors”PostgresServerLog(string, Guid)
Section titled “PostgresServerLog(string, Guid)”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.
Properties
Section titled “Properties”EventSource
Section titled “EventSource”Gets this server’s distinct provider name without registering a source or exposing machine identifiers.
public string EventSource { get; }Value: string
NativeFilePath
Section titled “NativeFilePath”Gets the native stderr target, separately from the retained Windows snapshot.
public string NativeFilePath { get; }Value: string
Methods
Section titled “Methods”Read(CancellationToken)
Section titled “Read(CancellationToken)”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.
ReadFile(string)
Section titled “ReadFile(string)”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.