Improved error logging with log4js