Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaforbes/cluster-logger
Get your worker child processes logs to show up in Cloudwatch or Papertrail when using cluster in NodeJS
https://github.com/jaforbes/cluster-logger
Last synced: about 1 month ago
JSON representation
Get your worker child processes logs to show up in Cloudwatch or Papertrail when using cluster in NodeJS
- Host: GitHub
- URL: https://github.com/jaforbes/cluster-logger
- Owner: JAForbes
- Created: 2016-02-27T08:42:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-02-27T08:51:16.000Z (over 8 years ago)
- Last Synced: 2024-10-10T07:49:02.876Z (about 1 month ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cluster-logger
Get your worker child processes logs to show up in Cloudwatch or Papertrail when using cluster in NodeJS#### Getting Started
Install `cluster-logger`
npm install cluster-logger
`require` it in your cluster script.
```js
require('cluster-logger')
```You're done.
#### What is this, why don't I need it?
This is a very simple solution to a very specific problem.
You are using the new `cluster` module in NodeJS. And you find that the logs of your spawned processes are not appearing in your
production log tracker.This module simply proxies `console.log` and `console.error` to `process.send({ type: 'log', message: ... })`.
It also creates a listener in the master process, to receive those logs and spit them out in the main stdio stream.