This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
wikipedia-game-solver/apps/api/config/logger.ts
Théo LUDWIG 4add77856e
All checks were successful
Chromatic / chromatic (push) Successful in 2m58s
CI / ci (push) Successful in 4m43s
CI / commitlint (push) Successful in 15s
chore: try Adonis Tuyau
2024-08-16 01:50:11 +01:00

35 lines
903 B
TypeScript

import env from "#start/env.ts"
import { defineConfig, targets } from "@adonisjs/core/logger"
import app from "@adonisjs/core/services/app"
const loggerConfig = defineConfig({
default: "app",
/**
* The loggers object can be used to define multiple loggers.
* By default, we configure only one logger (named "app").
*/
loggers: {
app: {
enabled: true,
name: env.get("APP_NAME"),
level: env.get("LOG_LEVEL"),
transport: {
targets: targets()
.pushIf(!app.inProduction, targets.pretty())
.pushIf(app.inProduction, targets.file({ destination: 1 }))
.toArray(),
},
},
},
})
export default loggerConfig
/**
* Inferring types for the list of loggers you have configured in your application.
*/
declare module "@adonisjs/core/types" {
export interface LoggersList extends InferLoggers<typeof loggerConfig> {}
}