seqeron 0.18.0
Loading...
Searching...
No Matches
Org.Limitless.Seqeron.Util.Logger Class Reference

Structured logging: call sites report a LoggerEvent to the installed ILoggerSink. The default sink prints [Component/memberId] message to stderr. More...

Classes

interface  ILoggerSink
 Where every log call lands. Install one with Install. More...
 

Public Types

enum  CoreComponent {
  Sequencer , SequencerServer , SequencerService , ConsensusModule ,
  ReplayerServer , ReplayerService , QueueRelay , ReplayerStreamReceiver ,
  Cluster , ClusterProbe
}
 The components core itself logs as, each named after the class or process that reports. More...
 
enum  Severity { Info , Warn , Error , Fault }
 How bad it is. More...
 
enum  CoreEventCode {
  Info , MalformedIngressMessage , ConsensusModuleError , ServiceError ,
  QueueBackpressure , StaleActiveRecording , QueueRecordingFailure , AppliedLogTruncated ,
  ControlReplyDropped , GatewayPromotionFailed , GatewayActivationTimeout , ReplayDutyCycleFailure ,
  ShutdownTimeout , RelaySourceLost , QueueUnresolved , QueueGap ,
  RecoveryStalled , QueueStalled , FirstFrameNotOne , SnapshotRestoreFailed ,
  SnapshotStoreFailed , ClusterSessionError , ClusterOfferFailed , ClusterIpcFallback
}
 Core's anomaly classes: one per condition worth telling apart, plus Info for the routine lines that identify no anomaly at all. The same names as Java's and C++'s. More...
 

Public Member Functions

record LoggerEvent (Enum Component, Severity Severity, Enum Code, int? MemberId, string Message)
 One log record, as a sink receives it.
 

Static Public Member Functions

static void Install (ILoggerSink sink)
 Installs the sink every subsequent call forwards to. The caller owns the sink's lifetime: a test's recording sink calls Reset before it goes out of scope.
 
static void Reset ()
 Restores the default sink, which prints to stderr.
 
static void Info (Enum component, int? memberId, string format, params object[] args)
 Logs routine status, at Severity.Info under CoreEventCode.Info.
 
static void Error (Enum component, Enum code, int? memberId, string format, params object[] args)
 Logs a fault the process carries on past, at Severity.Error.
 
static void Fault (Enum component, Enum code, int? memberId, string format, params object[] args)
 Logs one it does not, at Severity.Fault: the caller stops or fences itself after this.
 
static void Log (Enum component, Severity severity, Enum code, int? memberId, string format, params object[] args)
 The one call the others reach: formats args into format and hands the record to the installed sink.
 

Detailed Description

Structured logging: call sites report a LoggerEvent to the installed ILoggerSink. The default sink prints [Component/memberId] message to stderr.

Components and event codes are any enum, so a consumer declares its own beside CoreComponent and CoreEventCode; a value prints as its name.

Member Enumeration Documentation

◆ CoreComponent

The components core itself logs as, each named after the class or process that reports.

Enumerator
Sequencer 

The replicated state machine.

SequencerServer 

The node process.

SequencerService 

The sequencer's Aeron Cluster adapter.

ConsensusModule 

Aeron's own consensus module, whose errors reach this log through the service.

ReplayerServer 

The replay server.

ReplayerService 

That server's duty cycle.

QueueRelay 

On a gateway host, the relay that copies a member's queue onto the local one.

ReplayerStreamReceiver 

The client-side receiver, reporting from inside a consumer's replica.

Cluster 

The cluster session client, ClusterStreamSender.

ClusterProbe 

The end-to-end probe tool.

◆ CoreEventCode

Core's anomaly classes: one per condition worth telling apart, plus Info for the routine lines that identify no anomaly at all. The same names as Java's and C++'s.

Enumerator
Info 

Routine status, with no anomaly of its own to identify.

MalformedIngressMessage 

An ingress message the sequencer would not sequence; clusterSeqNo does not move.

ConsensusModuleError 

Aeron's consensus module raised an error.

ServiceError 

The clustered service raised one.

QueueBackpressure 

A queue offer back-pressured; the sequencer spins rather than drop the frame.

StaleActiveRecording 

An older recording still reports as recording, which an unclean shutdown leaves behind.

QueueRecordingFailure 

This node can no longer record the history it is responsible for.

AppliedLogTruncated 

The consensus module truncated this node's log below what it applied; its state is not the log's.

ControlReplyDropped 

A replay control reply was dropped, its subscriber having gone away.

GatewayPromotionFailed 

A gateway session closed with no standby to promote, leaving that gateway with none active.

GatewayActivationTimeout 

A designated instance never declared itself started in time.

ReplayDutyCycleFailure 

The Replayer's duty cycle failed, typically its media driver going away.

ShutdownTimeout 

A duty-cycle thread outlived the deadline for stopping, and is being left behind.

RelaySourceLost 

A gateway host's relay stopped reading one member's archive and moved to the next.

QueueUnresolved 

A replayer could not tell an instance which queue it reads; the instance waits until it can.

QueueGap 

The live queue skipped a clusterSeqNo; recovery replays the hole.

RecoveryStalled 

Recovery has dispatched nothing for longer than its deadline.

QueueStalled 

The queue has carried no ClusterHeartbeat for longer than its deadline.

FirstFrameNotOne 

The first frame observed was not clusterSeqNo 1, so history is incomplete.

SnapshotRestoreFailed 

A source's latest snapshot cannot be restored, so its instance cannot recover.

SnapshotStoreFailed 

This instance could not write or read a snapshot file of its own; it has no copy of that round.

ClusterSessionError 

The cluster session reported an error on submit.

ClusterOfferFailed 

Cluster ingress took no frame for long enough to call the session lost.

ClusterIpcFallback 

The co-located member did not answer IPC ingress, so the sender fell back to UDP.

◆ Severity

How bad it is.

Enumerator
Info 

Routine status.

Warn 

An anomaly that resolved itself, or is expected to.

Error 

A fault the reporting process carries on past.

Fault 

One it does not: the reporter stops, or fences itself, rather than carry on.

Member Function Documentation

◆ Error()

static void Org.Limitless.Seqeron.Util.Logger.Error ( Enum  component,
Enum  code,
int?  memberId,
string  format,
params object[]  args 
)
inlinestatic

Logs a fault the process carries on past, at Severity.Error.

Parameters
componentwho is reporting
codewhich anomaly class
memberIdthe node, or null
formata composite format string
argsits arguments

◆ Fault()

static void Org.Limitless.Seqeron.Util.Logger.Fault ( Enum  component,
Enum  code,
int?  memberId,
string  format,
params object[]  args 
)
inlinestatic

Logs one it does not, at Severity.Fault: the caller stops or fences itself after this.

Parameters
componentwho is reporting
codewhich anomaly class
memberIdthe node, or null
formata composite format string
argsits arguments

◆ Info()

static void Org.Limitless.Seqeron.Util.Logger.Info ( Enum  component,
int?  memberId,
string  format,
params object[]  args 
)
inlinestatic

Logs routine status, at Severity.Info under CoreEventCode.Info.

Parameters
componentwho is reporting
memberIdthe node, or null
formata composite format string
argsits arguments

◆ Install()

static void Org.Limitless.Seqeron.Util.Logger.Install ( ILoggerSink  sink)
inlinestatic

Installs the sink every subsequent call forwards to. The caller owns the sink's lifetime: a test's recording sink calls Reset before it goes out of scope.

Parameters
sinkthe sink

◆ Log()

static void Org.Limitless.Seqeron.Util.Logger.Log ( Enum  component,
Severity  severity,
Enum  code,
int?  memberId,
string  format,
params object[]  args 
)
inlinestatic

The one call the others reach: formats args into format and hands the record to the installed sink.

Parameters
componentwho is reporting
severityhow bad it is
codewhich anomaly class
memberIdthe node, or null for a process that is not a cluster node
formata composite format string
argsits arguments

◆ LoggerEvent()

record Org.Limitless.Seqeron.Util.Logger.LoggerEvent ( Enum  Component,
Severity  Severity,
Enum  Code,
int?  MemberId,
string  Message 
)
sealed

One log record, as a sink receives it.

Parameters
Componentwho is reporting
Severityhow bad it is
Codewhich anomaly class, or CoreEventCode.Info
MemberIdthe node it happened on, or null where there is no member context
Messagethe formatted text

◆ Reset()

static void Org.Limitless.Seqeron.Util.Logger.Reset ( )
inlinestatic

Restores the default sink, which prints to stderr.


The documentation for this class was generated from the following file: