Added API key authentication.
This commit is contained in:
@@ -34,3 +34,20 @@ export default function initLogger(customLabel) {
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
export function initAccessLogger() {
|
||||
return winston.createLogger({
|
||||
level: 'access',
|
||||
levels: {
|
||||
access: 0,
|
||||
},
|
||||
format: winston.format.printf((data) => JSON.stringify({ ...data.message, timestamp: new Date() })),
|
||||
transports: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
datePattern: 'YYYY-MM-DD',
|
||||
filename: path.join('log', 'access_%DATE%.log'),
|
||||
level: 'access',
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user