Skip to content

Switching logging to Bunyan #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

sntran
Copy link
Contributor

@sntran sntran commented Jul 15, 2015

This is an open pull request, as I will need feedbacks and suggestions until it's completed to close. Currently it has:

  • Using bunyan instead of winston.
  • Log messages may contain bid, key, ip, override fields depending on where the logger is called.
  • Supporting sending logs to loggy.

I tried to look for a way to calculate bandwidth but it seems to requires we use net instead of http for server since it needs to read bytesReceived and bytesSent. Therefore, I figure we can use services like Loggy to aggregate logs and look at accumulated responses' size and use it as data usage.

In Loggy, I could perform a search like this to see data usage:

screen shot 2015-07-15 at 3 01 07 pm

Son Tran-Nguyen added 5 commits July 14, 2015 09:48
- Custom levels (`event`, `verbose`) are aliased.
- Add tests for logging levels using vows.
- Add npm scripts: `npm start` and `npm test`
Add Bunyan's `Logger.prototype.event` instead of `event` function on
the logger instance.
Child loggers can contain `bid`, `key`, `ip`, `override` fields so that
any log calls will include them. This can help when aggregating logs.
@dtex
Copy link
Owner

dtex commented Jul 15, 2015

I figure we can use services like Loggy to aggregate logs and look at accumulated responses' size and use it as data usage.

This is exactly what I was thinking we could do.

Thank you for this. Charlie's a friend but he hasn't been keeping up with Winston so time to move on.

Requires setting environment variables `LOG_TOKEN` and `LOG_SUBDOMAIN"
(optional), i.e.:

```
LOG_TOKEN=xxxxxxxx LOG_SUBDOMAIN=spas node spas --dev --log=verbose
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants