inakianduaga / log-proxy-server Goto Github PK
View Code? Open in Web Editor NEWlogs-proxy-server
License: MIT License
logs-proxy-server
License: MIT License
Instead of passing the settings per request (too much overhead, too unconventional for documenting/implementing), we do the following
angular-project1 : ...
would be a set of configuration that we can access through angular-project1
key, etc). These definitions live on the server and must be hardcoded into the application (NOT the repo)This is much better since it's very simple to implement on the client side (no extra parameters on the client side), has no overhead on the log requests, and basically makes sense since the server will usually take logging from a small set of applications that can be preconfigured instead of some random request that would need really dynamic configuration
We are already using internally the node environment variables. We need to populate those variables from a standard .env
file.
Use one of these packages to handle environment passthrough
We need a way for a client to set the logging configuration once and that that will be used for all the calls within the session/or that use the given token. Easiest probably would be
Alternatively:
Alternatively:
Using https://github.com/inakianduaga/node-express-boilerplate as base project
We need to be able to throttle log requests from single clients otherwise we might log too much
https://www.npmjs.com/package/limiter (not sure if this is for clients or server, I think it's ok for server)
Instead of generating a new logger instance per request (which probably is bad performance-wise), now that we've moved to using predefined settings, we should use fixed loggers as Winston categories, and retrieve that to do the logging (if the logging is not there we initialize it the first time).
https://github.com/winstonjs/winston#working-with-multiple-loggers-in-winston
Perhaps it's best to initialize all the loggers based on all configurations all at once, then we can just use them. I don't think it should be such a hit in performance
We need to be able to handle json/form-multipart posts to the given endpoint.
https://github.com/swagger-api/swagger-node-express
This uses a swagger object where we insert definitions of the spec. Advantage seems to be that we can use for the errors the same code we would throw inside the methods. Bad thing is that it seems to couple the integration with swagger tightly into the controllers
https://www.npmjs.com/package/swagger-express
This one we add jsdoc comments to each controller route definition for example specifying the API for that endpoint
https://www.npmjs.com/package/swagger-tools
https://github.com/apigee-127/swagger-tools/blob/master/docs/QuickStart.md
This basically uses the swagger spec as the defining document and injects a few pieces of middleware that add the swagger routes to the app (using connect middleware)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.