Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.log.error

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > Log > error

Log.error() method

Logs an error.

Signature:

static error(source: string, error: Error, scope?: ServiceScope): void;

Parameters

Parameter Type Description
source string the source from where the error is logged, e.g., the class name. The source provides context information for the logged error. If the source's length is more than 20, only the first 20 characters are kept.
error Error the error to be logged
scope ServiceScope the service scope that the source uses. A service scope can provide more context information (e.g., web part information) to the logged error.

Returns:

void

Clone this wiki locally