Skip to main content

@rbxts/rlog > LogContext

LogContext class

Context for a collection of log entries.

Signature:

export declare class LogContext 

Remarks

Provides a centrialized means for tracking correlation ids, allowing you to create a linkage between log entries in individual logic flows- enabling more streamlined debugging in high traffic or asynchronous environments.

Constructors

Constructor

Modifiers

Description

(constructor)(correlation_id, config)

Constructor for manually creating a LogContext.

Properties

Property

Modifiers

Type

Description

config

readonly

RLogConfig

correlation_id

readonly

string

Methods

Method

Modifiers

Description

IsDead()

A context is considered dead after stop has been called.

start(config)

static

Creates a new LogContext.

stop()

Marks this context as dead, preventing any further usage.

use(config)

Creates a new RLog instance that inherits this context.

withConfig(config)

Creates a new LogContext instance that inherits this context.