-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
steamroller used by log4js-node? #136
steamroller used by log4js-node? #136
Comments
Yes,
|
node v16.14.0 This is the code that configures log4js. We import this throughout the codebase whenever logging is needed and just use import fs from 'fs';
import log4js from 'log4js';
if (fs.existsSync('log4js-config.json')) {
log4js.configure('log4js-config.json');
} else {
log4js.configure({
appenders: {
app: { type: 'file', filename: 'app.log' },
out: { type: 'stdout' },
multi: {
type: 'multiFile',
base: 'logs/',
property: 'categoryName',
extension: '.log',
maxLogSize: 1024
}
},
categories: {
default: {
appenders: [
'app',
'out',
'multi'
],
level: 'error'
},
parse: {
appenders: [
'app',
'out',
'multi'
],
level: 'error'
},
validate: {
appenders: [
'app',
'out',
'multi'
],
level: 'error'
},
cli: {
appenders: [
'app',
'out',
'multi'
],
level: 'info'
}
}
});
}
export default log4js; When using a file configuration, we just copy that hard-coded config into a file. |
If I take out the |
This configuration also cases the same error: import fs from "fs";
import * as log4js from "log4js";
if (fs.existsSync("log4js-config.json")) {
log4js.configure("log4js-config.json");
} else {
log4js.configure({
appenders: {
sblsp: { type: "file", filename: `~/sblsp.log` },
out: { type: "stdout" },
},
categories: {
default: {
appenders: ["sblsp", "out"],
level: "debug",
},
},
});
}
export default log4js; |
|
For simplicity I did not have a json file. So only the hard-coded config is being used when I last reproduced. |
Tried with 6.4.7 and removing the |
|
macOS 12.3.1. With that latest config there's no multiFile appender, so I dont know if it's trying to roll. It did update to 3.0.9. |
Can you run the following as Trying to see if it happens on the
|
I had to tweak the log4js import like so: Here is the output. The first one is without a
|
Btw, I created a separate NPM project when I ran that, not in our existing project which is a VS Code extension. If I try running our VS Code extension with the |
Strange, I copied and pasted from your original codes. Doesn't matter now since you got it resolved.
|
The sblsp.log file is getting generated in a ~ dir like you said. However I don't get the call stack error. When I run my VS Code extension, I do get the call stack error but I dont see a ~ folder. If I use
With the new code you provided, I get this error:
|
My bad, it should have been |
No problem. Using |
Seems like the call stack error is unique to the VS Code extension together with the usage of For the Out of curiosity, which VS Code extension is that? |
It's one that we are working on internally. It is not yet open sourced. I will try a different path for now and see if the call stack error goes away. |
Keep me updated! Maybe I should expand the tilde manually as a new feature. |
So using |
|
Does log4js use
steamroller
for log file rotation? We are getting a maximum call stack size exceeded error withsteamroller
calls but we don't explicitly use this package. We do usemultiFile
appender with a few backups.The text was updated successfully, but these errors were encountered: