mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
27 lines
766 B
TypeScript
27 lines
766 B
TypeScript
import { utilities as nestWinstonModuleUtilities } from 'nest-winston';
|
|
import * as winston from 'winston';
|
|
|
|
export const winstonLoggerOptions: winston.LoggerOptions = {
|
|
level:
|
|
process.env.AZURE_POSTGRESQL_DATABASE === 'development' ? 'debug' : 'error',
|
|
transports: [
|
|
new winston.transports.Console({
|
|
format: winston.format.combine(
|
|
winston.format.timestamp(),
|
|
nestWinstonModuleUtilities.format.nestLike('MyApp', {
|
|
prettyPrint: true,
|
|
}),
|
|
),
|
|
}),
|
|
new winston.transports.File({
|
|
filename: 'logs/error.log',
|
|
level: 'error',
|
|
format: winston.format.json(),
|
|
}),
|
|
new winston.transports.File({
|
|
filename: 'logs/combined.log',
|
|
format: winston.format.json(),
|
|
}),
|
|
],
|
|
};
|