Created
July 24, 2017 22:35
-
-
Save nomiddlename/99b7530281debc926d5e7b8a3b87350f to your computer and use it in GitHub Desktop.
PM2 test files for log4js-node issue #265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const log4js = require('../lib/log4js'); | |
// NOTE: for PM2 support to work you'll need to install the pm2-intercom module | |
// `pm2 install pm2-intercom` | |
log4js.configure({ | |
appenders: { | |
out: { type: 'file', filename: 'pm2logs.log' } | |
}, | |
categories: { | |
default: { appenders: ['out'], level: 'info' } | |
}, | |
pm2: true, | |
pm2InstanceVar: 'INSTANCE_ID' | |
}); | |
const logger = log4js.getLogger('app'); | |
setInterval(() => { | |
logger.info("I'm forever blowing bubbles"); | |
}, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "apps": [ | |
{ "name": "testing", | |
"script": "pm2.js", | |
"instances": 0, | |
"instance_var": "INSTANCE_ID", | |
"exec_mode": "cluster" | |
} | |
] | |
} |
I was running this in my local log4js-node, from the examples directory (hence the '../lib/log4js' path in the require).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
node v8.2.1, pm2 2.6.1, pm2-intercom 1.0.0
npm install -g pm2
pm2 install pm2-intercom
pm2 start pm2.json