-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Logs support. #243
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
Logs support. #243
Conversation
TODO: Add unit tests prior to merge. |
@peterdotjs Would it be possible to syndicate those logs in a mongo? So multiple server would write in the logs DB and we could keep the order in the case of multiple front-end instances? |
@flovilmart Absolutely! Either the community or team should work on creating an adapter to support the multiserver case. |
@peterdotjs so in that case, could you refactor a bit the logger as FileLogger.js? This way we'll be able to drop in more logging solution. |
@flovilmart yup that sounds good I'll rename to match the transport. |
Wonderful! In the end that's just Winston transports to add. |
Added /logs endpoint with basic logger and LoggerAdapter.
2ac85b9
to
dc4859f
Compare
Updated with test, es6 and new adapter/controller style. |
@peterdotjs updated the pull request. |
const MILLISECONDS_IN_A_DAY = 24 * 60 * 60 * 1000; | ||
|
||
// only allow request with master key | ||
let enforceSecurity = (auth) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nikita made a middleware for enforcing master key that you should probably use instead. Or if you are too busy, we can update this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer this for now and add it in when I add the docs.
If you could either make this experimental (using a env var or something) or add unit or e2e tests I would appreciate it :) up to you though, if you think the code is solid, just ship it. It's not like it will corrupt any DBs or anything. |
@drew-gross |
Added /logs endpoint with basic logger and LoggerAdapter.
GET
for /logs is implemented. Query params designed to match loggly interface.info
,error
andquery
methods to be implemented.