Server/project/src/utils/logging/WinstonMainLogger.ts

44 lines
969 B
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { IAsyncQueue } from "@spt-aki/models/spt/utils/IAsyncQueue";
import { IUUidGenerator } from "@spt-aki/models/spt/utils/IUuidGenerator";
import { AbstractWinstonLogger } from "@spt-aki/utils/logging/AbstractWinstonLogger";
2023-03-03 15:23:46 +00:00
@injectable()
export class WinstonMainLogger extends AbstractWinstonLogger
{
constructor(
@inject("AsyncQueue") protected asyncQueue: IAsyncQueue,
@inject("UUidGenerator") protected uuidGenerator: IUUidGenerator
)
{
super(asyncQueue, uuidGenerator);
}
protected isLogExceptions(): boolean
{
return true;
}
protected isLogToFile(): boolean
{
return true;
}
protected isLogToConsole(): boolean
{
return true;
}
protected getFilePath(): string
{
return "./user/logs/";
}
protected getFileName(): string
{
return "server-%DATE%.log";
}
}