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
Constructor | Modifiers | Description |
---|---|---|
(constructor)(logger, namespace, properties, propertyGetters) | Constructs a new instance of the ChildLogger class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
logger | ITelemetryBaseLogger |
Methods
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
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
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:
send
Send an event with the logger
Signature:
send(event: ITelemetryBaseEvent): void;
Parameters
Parameter | Type | Description |
---|---|---|
event | ITelemetryBaseEvent | the event to send |
Returns:
void