Skip to content
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

log files are not generated day wise #2

Closed
mratanusarkar opened this issue Feb 28, 2023 · 0 comments · Fixed by #3
Closed

log files are not generated day wise #2

mratanusarkar opened this issue Feb 28, 2023 · 0 comments · Fixed by #3
Labels
bug Something isn't working

Comments

@mratanusarkar
Copy link
Owner

The day-wise logging is not working as expected.

For server code or scripts that are running for a long time (more than a day),
All the logs seem to be getting dumped into the first file that is generated during the first run.

The Ideal behavior should be: on a new day, a new log file should be generated with the file name as datetime.

The below code seems to be working for scripts (with limited runtime) that are manually run every time,
but not for code deployed on a server that is running 24x7.

// output file
let logDir = './logFiles/';
let date = new Date().toISOString().split('T')[0];
let errorFilePath = logDir + date + '-' + 'error.log';
let comboFilePath = logDir + date + '-' + 'combined.log';
@mratanusarkar mratanusarkar added the bug Something isn't working label Feb 28, 2023
@mratanusarkar mratanusarkar linked a pull request Feb 28, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant