On This Page

Logging and Diagnostics

21 symbols from @neontechspace/fluxerly/effect

Interfaces#

ClientLogging#

Change what this client logs while it runs

Creation settings other than level, categories and debug, such as sink and format, stay fixed for the client's lifetime

interface ClientLogging

configure#

Replace the client's log level and per-category levels, and optionally its Debug categories, effective for the next record

The settings are validated like level, categories and debug in the logging option of createClient. Omitted level and categories return to their defaults, level info without category levels, as at creation. An omitted debug keeps the current Debug categories, which start as the debug creation setting plus FLUXERLY_DEBUG. A debug value replaces them, including those from FLUXERLY_DEBUG. Pass true for every category, a list for only those categories, or false or an empty list for none. Debug categories lower their threshold to Debug, never raise it. It works before, during and after a connection, and changes nothing else about the client

configure(settings: LogLevelSettings): voidconfigure(
  settings: LogLevelSettings
): void

Parameters

Returns synchronously. Invalid settings, including keys other than level, categories and debug, throw ConfigurationError and leave the previous settings in place. A throwing settings getter throws SdkDefect with code application.defect

TypeScript
import type { Client } from "@neontechspace/fluxerly/effect"
export function traceRequests(client: Client) {
    client.logging.configure({ categories: { rest: "debug" } })
}
export function stopDebugOutput(client: Client) {
    client.logging.configure({ debug: false })
}

FailureReport#

A failure outside any returned result, delivered to a native onError hook or logged at Error with its full error

The error field is the handler's typed failure or defect value, and cause keeps the complete Effect Cause, including every reason. The message reference contains IDs only. The original error and Cause can contain message content or other application data

interface FailureReport extends FailureReportinterface FailureReport
  extends FailureReport
cause#

The complete Effect Cause of the failure

Cause<unknown>

Inherited from FailureReport: command, error, event, kind, message, subscriptionId, describe

Re-Exports#

Declared in JavaScript & TypeScript and documented there. Import them from @neontechspace/fluxerly/effect as well

ClientCounters#
Running totals for one client since creation, returned by diagnostics().counters
ClientDiagnostics#
Inspect this client's current connection state, occupied request slots and cache usage
ErrorInfo#
Readable facts about an error attached to a log record or failure report
FailureMessageReference#
IDs of the message involved in a failure, without its content
HandlerObservation#
One finished event handler or prefix command router invocation, including event and command middleware
LogRecord#
One structured SDK log record, delivered frozen to sinks and printed by the built-in console output
LoggingOptions#
Configure what the SDK logs and where the output goes
RateLimitObservation#
A REST request that waits before retrying because Fluxer rate-limited it with HTTP 429
ReconnectObservation#
A shard begins a reconnection attempt after its established connection was lost
RestObservation#
One finished REST request attempt
ResumeObservation#
A shard resumed its session, so Fluxer replays the events it missed
FailureKind#
What failed
LogCategory#
The SDK area that produced a log record
LogLevel#
Severity of an SDK log record, from most to least verbose
LogLevelSettings#
The level, categories and debug settings of LoggingOptions, which client.logging.configure changes while a client runs
LogSink#
A synchronous callback that receives each emitted SDK record
LogThreshold#
A minimum severity for SDK log output, or silent to emit nothing
Observation#
One structured measurement passed to the observe client option
Observer#
Receive structured measurements of this client's work, such as REST request durations, rate-limit waits, reconnection attempts, resumed sessions and handler durations, to export as metrics or traces to any monitoring system