Skip to content

StderrAppender

@tsed/logger

Usage

typescript
import { StderrAppender } from "@tsed/logger";

See /packages/logger/src/types/node/appenders/StderrAppender.ts.

Overview

ts
class StderrAppender extends BaseAppender {
    write(loggingEvent: LogEvent): void;
}

Description

Standard Error Appender

This appender writes all log events to the standard error stream.

Configuration

  • type - stderr
  • layout - object (optional, defaults to colouredLayout) - see layouts

Example

typescript
import {Logger} from "@tsed/logger";

const logger = new Logger("loggerName");

logger.appenders.set("log-error", {
    type: "stderr",
    levels: ["error", "warn", "fatal"]
});

write

ts
write(loggingEvent: LogEvent): void;

Released under the MIT License.