Action Logging
Log Level | Purpose | Default |
---|---|---|
info | Logs middleware and action handler registration info | Enabled |
warn | Logs warnings | Enabled |
error | Logs errors that occurs middleware and action handlers | Enabled |
debug | Logs input context for every middleware and action handlers | Disabled |
Opt-in for specific logs
// --snip--
const router = new ActionRouter({
// only logs `info` and `error` logs
logging: [{ level: "error" }, { level: "info" }],
});
Opt-in conditionally
// --snip--
const router = new ActionRouter({
logging: process.env.NODE_ENV === "production"
? [{ level: "error" }, { level: "info" }]
: [
{ level: "error" },
{ level: "info" },
{ level: "warn" },
{ level: "debug" },
];
});
Disable
// --snip--
const router = new ActionRouter({
logging: [], // pass in empty array
});