Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDebug namespace is not microservices (SOA) oriented #3062
Comments
|
Just a comment, but this seems like it may be a better request in the |
|
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 :) |
|
@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? |
|
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. |
|
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 :) |
Express uses hardcoded values for debug namespace, for example:
express/lib/router/index.js
Line 20 in b69b760
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.