Store logs to file
This commit is contained in:
parent
19fab7fa97
commit
d33663f5ac
|
@ -5,6 +5,9 @@ import * as correlation from "../correlation"
|
|||
import { IdentityType } from "@budibase/types"
|
||||
import { LOG_CONTEXT } from "../index"
|
||||
|
||||
import path from "path"
|
||||
import { budibaseTempDir } from "../../objectStore"
|
||||
|
||||
// LOGGER
|
||||
|
||||
let pinoInstance: pino.Logger | undefined
|
||||
|
@ -29,6 +32,13 @@ if (!env.DISABLE_PINO_LOGGER) {
|
|||
singleLine: true,
|
||||
},
|
||||
}
|
||||
} else {
|
||||
pinoOptions.transport = {
|
||||
target: "pino/file",
|
||||
options: {
|
||||
destination: path.join(budibaseTempDir(), "pino.logs"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pinoInstance = pino(pinoOptions)
|
||||
|
|
Loading…
Reference in New Issue