Skip to content
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

Debug namespace is not microservices (SOA) oriented #3062

Open
rafis opened this issue Aug 23, 2016 · 5 comments
Open

Debug namespace is not microservices (SOA) oriented #3062

rafis opened this issue Aug 23, 2016 · 5 comments

Comments

@rafis
Copy link

@rafis rafis commented Aug 23, 2016

Express uses hardcoded values for debug namespace, for example:

var debug = require('debug')('express:router');

and it is extremly hard to determine in output where things are happening while doing TDD on microservices architecture. It would be nice to allow to specify prefix for namespace, i.e. per microservice which is an express app.

@blakeembrey
Copy link
Member

@blakeembrey blakeembrey commented Aug 23, 2016

Just a comment, but this seems like it may be a better request in the debug module. Otherwise you'll probably end up opening this issue on every module in the node ecosystem using debug when you may be able to propose a change there instead.

@wesleytodd
Copy link
Member

@wesleytodd wesleytodd commented Aug 23, 2016

I think a better solution for this is to push logging to the application level. Preferably by exposing an event for debug logs where the consumer can listen and log on their own. And I think this needs to be something the node ecosystem adopts. Because in the current state, like @rafis points out, package debug logging doesn't work in a large set of application environments.

EDIT: this is actually something I have thought a lot on because we run about 90 SOA services, and it has been a bone I wanted to pick for a while and this is how we solved the problem internally :)

@blakeembrey
Copy link
Member

@blakeembrey blakeembrey commented Aug 23, 2016

@wesleytodd Can you provide more information? Expecting every module to adopt a pattern is going to be extremely difficult and realistically isn't something that can be changed. I don't run a microservice architecture, but can't whatever you're using to run each of the services be configured to log with a prefix instead and use that to identify each container?

@wesleytodd
Copy link
Member

@wesleytodd wesleytodd commented Aug 24, 2016

I will start a gist of my thoughts on this and post back here when I have a concrete definition of the problem and a proposed solution.

@LinusU
Copy link
Member

@LinusU LinusU commented Aug 25, 2016

In the setup I'm currently running, every application logs to syslog with their own tag. Something like this:

export DEBUG='*'
npm start 2>&1 | logger -t 'my-first-app'

It has worked very well for me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.