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

Introduce logs to log information in structured way #63

Open
priyaaank opened this issue Oct 19, 2020 · 1 comment
Open

Introduce logs to log information in structured way #63

priyaaank opened this issue Oct 19, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Projects
Milestone

Comments

@priyaaank
Copy link
Member

Is your feature request related to a problem? Please describe.
Clamp currently does not have a structured logging mechanism, this issue requests that logging should be done in a structured way and can be used/attached in case of issues that users may face while using the library.

Describe the solution you'd like
There are several aspects that are important to consider as a logging structure is set up

  • Log level should be provided as an environment variable to the clamp core. This way debug logs should be enabled whenever needed.
  • Configuration should be supported to either log to a file or to the STDOUT/STDERR
  • Log files should be rotated to ensure that they can be periodically cleaned up without running out of space. The logging policy should be configurable.
  • Format for logging should be structured so that in case the logs are aggregated centrally, they can be made queriable.

Describe alternatives you've considered
Alternatives are that logs are always sent to STDOUT, which means that OS will redirect the logs to the default logging file.

Additional context
None

@priyaaank priyaaank added the enhancement New feature or request label Oct 19, 2020
@priyaaank priyaaank added this to the Release Thor milestone Oct 19, 2020
@priyaaank priyaaank added this to To do in clamp via automation Oct 19, 2020
@priyaaank priyaaank self-assigned this Oct 20, 2020
@priyaaank priyaaank moved this from To do to In progress in clamp Oct 20, 2020
@sivachandran
Copy link
Contributor

@priyaaank I had great success using logrus in my previous project. It is one of the widely used logging libraries in the Go ecosystem. There are faster alternatives like zap, zerolog, etc. But I feel logrus would suit better for Clamp.

Migrating existing implementation won't be a big effort in my analysis. logrus provides Printf and Println functions. So, it should be a drop-in replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
clamp
  
In progress
Development

No branches or pull requests

2 participants