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

Add trace level log support in containerd. #2028

Closed
Random-Liu opened this issue Jan 19, 2018 · 9 comments
Closed

Add trace level log support in containerd. #2028

Random-Liu opened this issue Jan 19, 2018 · 9 comments

Comments

@Random-Liu
Copy link
Member

Description

logrus doesn't support trace. But it is useful in general containerd/cri#548.

In https://github.com/containerd/cri-containerd/pull/547/files#diff-1135f265d25e96e557b8114567653176 we added the library to support Trace in cri-containerd.

Can we have this library in containerd? Or can we at least accept trace in log-level flag?

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Output of containerd --version:

(paste your output here)
@Random-Liu Random-Liu changed the title Add trace support in containerd. Add trace level log support in containerd. Jan 19, 2018
@crosbymichael
Copy link
Member

Why not just use debug level instead of adding more levels. we already have fatal, error, warn, info, and debug. I think we can find an existing one

@Random-Liu
Copy link
Member Author

Random-Liu commented Jan 19, 2018

Here is our use case:

  • One log level for normal production log output (corresponds to logrus info)
  • One log level for test environment output (corresponds to logrus debug)
  • One log level for actual debug, we don't want to log this in test environment, because they are too spammy. But we do want to be able to turn on those logs when we actually see a problem and try to debug. (corresponds to what? I think this is where trace is useful.)

Is there any other way to solve this? Or shouldn't we add "trace level" logs?

@crosbymichael
Copy link
Member

So trace is a level below debug?

@mlaventure
Copy link
Contributor

@crosbymichael that's how it is treated in other logging library. Usually the expectation is that that level will log every entry and exit within a function.

@crosbymichael
Copy link
Member

ok, sounds good to me.

@stevvooe any thoughts ?

@stevvooe
Copy link
Member

stevvooe commented Feb 7, 2018

@crosbymichael Do we want to upstream the TraceLevel?

@crosbymichael
Copy link
Member

That would be ideal

@stevvooe
Copy link
Member

stevvooe commented Feb 7, 2018

@Random-Liu I am a maintainer there...

I think the problem with sirupsen/logrus#652 is that it is not backwards compatible for those using the interface to define a logger type. I'll LGTM it and see if that is a concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants