pm2 install pm2-loggly
You can see this inside of package.json
.
"config": {
"logglyClient": {
"token": "your-token",
"subdomain": "your-subdomain",
"tags": "your-tag-1,your-tag-2"
},
"pm2Apps": "your-app-1,your-app-2"
}
logglyClient.token
: a token fromhttps://your-subdomain.loggly.com/tokens
logglyClient.subdomain
: your Loggly subdomainlogglyClient.tags
: a comma-delimited list of global tags applied to all logspm2Apps
: a comma-delimited list of apps allowed to log to Loggly (logs will be tagged with the app name as well)
In your terminal run each of these commands:
pm2 set pm2-loggly.logglyClient.token my-extra-long-token-from-loggly
pm2 set pm2-loggly.logglyClient.subdomain mylogglysubdomain
pm2 set pm2-loggly.logglyClient.tags tag1,tag2,tag3
pm2 set pm2-loggly.pm2Apps app1,app2,app3
- Edit
~/.pm2/module_conf.json
and add something like this inside the first{}
:
"pm2-loggly": {
"logglyClient": {
"token": "my-extra-long-token-from-loggly",
"subdomain": "mylogglysubdomain",
"tags": "tag1,tag2,tag3"
},
"pm2Apps": "app1,app2,app3"
}
- Edit
pm2-loggly/package.json
and replace the default configuration above with:
"config": {
"logglyClient": {
"token": "my-extra-long-token-from-loggly",
"subdomain": "mylogglysubdomain",
"tags": "tag1,tag2,tag3"
},
"pm2Apps": "app1,app2,app3"
}