Skip to content 

ChildLogger Class

Packages > @fluidframework/telemetry-utils > ChildLogger

ChildLogger class contains various helper telemetry methods, encoding in one place schemas for various types of Fluid telemetry events. Creates sub-logger that appends properties to all events

Signature:

export declare class ChildLogger extends TelemetryLogger 

Extends: TelemetryLogger

Constructors

List of constructors for this class
Constructor Modifiers Description
(constructor)(logger, namespace, properties, propertyGetters) Constructs a new instance of the ChildLogger class

Properties

List of properties for this class
Property Modifiers Type Description
logger ITelemetryBaseLogger

Methods

List of methods on this class
Method Modifiers Description
create(baseLogger, namespace, properties, propertyGetters) static Create child logger
send(event) Send an event with the logger

Constructors

ChildLogger.(constructor)

Constructs a new instance of the ChildLogger class

Signature:

constructor(logger: ITelemetryBaseLogger, namespace?: string, properties?: ITelemetryProperties, propertyGetters?: ITelemetryPropertyGetters);

Parameters

List of parameters
Parameter Type Description
logger ITelemetryBaseLogger
namespace string
properties ITelemetryProperties
propertyGetters ITelemetryPropertyGetters

Properties

logger

Signature:

protected readonly logger: ITelemetryBaseLogger;

Methods

create

Create child logger

Signature:

static create(baseLogger?: ITelemetryBaseLogger, namespace?: string, properties?: ITelemetryProperties, propertyGetters?: ITelemetryPropertyGetters): TelemetryLogger;

Parameters

List of parameters
Parameter Type Description
baseLogger ITelemetryBaseLogger Base logger to use to output events. If undefined, proper child logger is created, but it does not sends telemetry events anywhere.
namespace string Telemetry event name prefix to add to all events
properties ITelemetryProperties Base properties to add to all events
propertyGetters ITelemetryPropertyGetters Getters to add additional properties to all events

Returns:

TelemetryLogger

send

Send an event with the logger

Signature:

send(event: ITelemetryBaseEvent): void;

Parameters

List of parameters
Parameter Type Description
event ITelemetryBaseEvent the event to send

Returns:

void