mirror of
https://github.com/feathersjs/feathers.git
synced 2025-12-08 19:46:22 +00:00
792 B
792 B
| outline |
|---|
| deep |
Logging
Logger
The src/logger.ts file initialises the widely used Winston logger library, by default with the info log level, logging to the console.
import { createLogger, format, transports } from 'winston'
// Configure the Winston logger. For the complete documentation see https://github.com/winstonjs/winston
export const logger = createLogger({
// To see more detailed errors, change this to 'debug'
level: 'info',
format: format.combine(format.splat(), format.simple()),
transports: [new transports.Console()]
})
You can import the logger directly in any file where you want to add logging information.
import { logger } from './logger'
logger.info('Log some information here')