Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

When log file doesn't exist, it should be automatically created #121

kadishmal opened this Issue Mar 6, 2013 · 4 comments


None yet
3 participants

Since at the initial stage of the app, no log files exist, log4js needs to create required log files automatically without failing.

Since no log files existed on my clean machine, the following error was constantly displayed:

log4js.fileAppender - Writing to file /XXXXXXX/assets/logs/XXXX.log, error happened  { [Error: ENOENT, open '/XXXXXXX/assets/logs/XXXX.log']
  errno: 34,
  code: 'ENOENT',
  path: '/XXXXXXX/assets/logs/XXXX.log' }

nomiddlename commented Mar 7, 2013

It should create the file if it doesn't exist, but it won't create the parent directories if those don't exist. Is this the case here?

Yes. It would be much more convenient if it created the directories as well. mkdirp would help in this case.

qlqllu commented May 29, 2014

Do you have plan to fix this issue? It's a very common error, because the log folder is configured in config file, so, we can't create the folder for log4js.


nomiddlename commented Jul 8, 2017

This issue has been fixed a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment