const fs = require('fs'); var date = new Date(); // var dat= date.getDate()+"-"+(date.getMonth()+1)+"-"+date.getFullYear(); var dat= `${date.getFullYear()}-${(date.getMonth()+1)}-${date.getDate()}`; var err_log = "./pm2/logs/err.log"; var out_log = "./pm2/logs/out.log"; fs.mkdirSync(`./pm2/logs/${dat}`, { recursive: true }); err_log = './pm2/logs/' + dat + '/error.log'; out_log = './pm2/logs/' + dat + '/output.log'; combined_log = './pm2/logs/' + dat + '/combined.log'; module.exports = { apps: [ { name: 'hotelhub', script: 'bin/www', max_memory_restart: "500M", merge_logs: true, max_restarts: 20, error_file: err_log, out_file: out_log, // instances: 1, // watch: false, // default: true watch: ["."], watch_delay: 1000, ignore_watch : ["node_modules", "logs", "pm2", "doc", "public", "views", "\\.git", "*.log"], } ] }