working on fixing logger
This commit is contained in:
parent
5b8c91f31d
commit
4709887fef
3 changed files with 16 additions and 45 deletions
|
|
@ -21,6 +21,7 @@ export interface RequestConfig {
|
|||
headers?: Record<string, string>;
|
||||
body?: any;
|
||||
timeout?: number;
|
||||
proxy?: ProxyConfig;
|
||||
}
|
||||
|
||||
export interface HttpResponse<T = any> {
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@ function createTransports(serviceName: string, options?: {
|
|||
target: 'pino-pretty',
|
||||
level: loggingConfig.LOG_LEVEL,
|
||||
options: {
|
||||
minimumLevel: 'info',
|
||||
colorize: true,
|
||||
translateTime: 'yyyy-mm-dd HH:MM:ss.l',
|
||||
ignore: 'pid,hostname,service,environment,version',
|
||||
messageFormat: '[{service}] {msg}',
|
||||
ignore: 'pid,hostname',
|
||||
// messageFormat: '[{service}] {msg}',
|
||||
// errorLikeObjectKeys: ['err', 'error'], // Tell pino-pretty these are error objects
|
||||
// errorProps: 'message,stack,name,code', // Which error properties to show
|
||||
singleLine: true,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -192,7 +194,6 @@ export class Logger {
|
|||
const logData = {
|
||||
...this.context,
|
||||
...metadata,
|
||||
timestamp: new Date().toISOString()
|
||||
};
|
||||
|
||||
if (typeof message === 'string') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue