Is there a way to automatically log all console logs, including failed expectations and exceptions, to a file without using try and catch in JavaScript? In Java's LOG4j, the rootlogger feature does this by default. Is there a similar functionality available in log4JS for JavaScript?
log4js.configure({
appenders: [
{
type: "clustered",
appenders: [
{
type: "dateFile",
filename: "log/access.log",
pattern: "-yyyy-MM-dd",
category: "http"
},
{
type: "file",
filename: "log/app.log",
maxLogSize: 10485760,
numBackups: 3
},
{
type: "logLevelFilter",
level: "ERROR",
appender: {
type: "file",
filename: "log/errors.log"
}
}
]
}
]
})