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

[feature] Added server side logging #239

Closed
wants to merge 2 commits into from

Conversation

codesankalp
Copy link
Member

Closes #82

Tasks done:

  1. Added Winston for logging
  2. Integrated morgan with Winston to log HTTP requests
  3. Removed checking for status code to handle timeout error and connection refused error.

@codesankalp codesankalp self-assigned this May 20, 2021
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think by default we should do:

  • log level: debug if development, warning if production (as you did) but should be possible to override this in some way (env var? what's the best practice here?)
  • output: console by default, but should be possible to configure it (following the same method that we'l chose for log level) to a different transport

Can we log HTTP requests by default during dev?

Please also add information to the README on how to override logging configuration.

server/utils/logger.js Show resolved Hide resolved
server/loggerConfig.js Show resolved Hide resolved
server/morganMiddleware.js Show resolved Hide resolved
@nemesifier nemesifier added this to In progress in [GSoC 2021] wifi-login-pages via automation May 22, 2021
@codesankalp codesankalp moved this from In progress to Review in progress in [GSoC 2021] wifi-login-pages May 24, 2021
server/loggerConfig.js Show resolved Hide resolved

| Environment Variable | Detail |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **LOG_LEVEL** | (optional) This can be used to set the level of logging. The available values are `warn` and `debug`. By default log level is set to `debug` during development and `warn` during production. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The available values are warn and debug.

What about info and error?

@nemesifier
Copy link
Member

Please open the PR from a branch of this repository.

@nemesifier nemesifier closed this May 24, 2021
[GSoC 2021] wifi-login-pages automation moved this from Review in progress to Done May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[wifi-login-pages] Add server side logging (nodejs)
2 participants