Checkout: only customer fields on order updates, verified PayPal capture, safe logging #6
+8
-1
@@ -1,10 +1,17 @@
|
||||
import { winston } from "@strapi/logger";
|
||||
import { formatLogLine } from "../src/logging/format";
|
||||
|
||||
// Strapi 4.25 creates its logger from @strapi/logger's default configuration with this object assigned over it
|
||||
// (Strapi.js: createLogger(this.config.get("logger"))). Its default level is "silly", which writes every line, also the debug and
|
||||
// silly lines with order data such as names and addresses. Production (NODE_ENV=production in mp's compose.yml) writes info and
|
||||
// above, any other environment debug and above.
|
||||
const level = process.env.NODE_ENV === "production" ? "info" : "debug";
|
||||
|
||||
export default {
|
||||
level,
|
||||
transports: [
|
||||
new winston.transports.Console({
|
||||
format: winston.format.combine(winston.format.printf(formatLogLine))
|
||||
format: winston.format.combine(winston.format.printf((info) => formatLogLine(info, { stack: level === "debug" })))
|
||||
})
|
||||
]
|
||||
};
|
||||
Reference in new issue
Block a user