#
Baselime Winston Transport
Send structured logs to Baselime with winston and the @baselime/winston-transport
.
Step 1: Install the Transport
npm i @baselime/winston-transport
Step 2: Set up the Winston Logger with the Baselime Transport.
Get your public BASELIME_API_KEY
from the Baselime Console
import winston from 'winston';
import { BaselimeTransport } from '@baselime/winston-transport';
const logger = winston.createLogger({
transports: [
new BaselimeTransport({
baselimeApiKey: 'BASELIME_API_KEY'
});
]
})
Step 3: Use the logger
logger.error("I will display in the Baselime Error Page");
logger.info("Logging with Winston and Baselime is AWESOME", {
winston: "AWESOME",
baselime: "AWESOME",
logging: "AWESOME"
});
#
Configuration
The @baselime/winston-transport
takes the following options