Skip to content

Fine control of libdevmapper logging#32541

Closed
jwhonce wants to merge 1 commit intomoby:masterfrom
jwhonce:wip/dm_logging
Closed

Fine control of libdevmapper logging#32541
jwhonce wants to merge 1 commit intomoby:masterfrom
jwhonce:wip/dm_logging

Conversation

@jwhonce
Copy link
Copy Markdown
Contributor

@jwhonce jwhonce commented Apr 11, 2017

Allow libdevmapper logging to be configured when starting the daemon
rather than at compile time to better facilitate debugging. The logrus
log level from the daemon is mapped unto the libdevmapper log entries
for filtering.

The additional libdevmapper levels not included within the logrus
framework are logged within the text of the log entry.

Chang log:
Match libdevmapper graphdriver log level to logrus level within daemon.

Signed-off-by: Jhon Honce jhonce@redhat.com

@jwhonce
Copy link
Copy Markdown
Contributor Author

jwhonce commented Apr 11, 2017

@cpuguy83 When debugging devicemapper issues from customers I found I wanted to see more detail from libdevmapper. This PR allows me to do so without rebuilding docker.

@thaJeztah
Copy link
Copy Markdown
Member

Would it make sense to do this automatically if the daemon is put in debug mode?

@jwhonce
Copy link
Copy Markdown
Contributor Author

jwhonce commented Apr 12, 2017

@thaJeztah I thought about doing just that, but the amount of output could have an effect on debugging other areas of the daemon. So I limited the scope.

@jwhonce jwhonce force-pushed the wip/dm_logging branch 4 times, most recently from 8dee77f to d498009 Compare April 12, 2017 18:43
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd prefer to not expose this to users. Passing through the logrus logging level seems the easiest way to set this.

Allow libdevmapper logging to be configured when starting the daemon
rather than at compile time to better facilitate debugging. The logrus
log level from the daemon is mapped unto the libdevmapper log entries
for filtering.

The additional libdevmapper levels not included within the logrus
framework are logged within the text of the log entry.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
@jwhonce
Copy link
Copy Markdown
Contributor Author

jwhonce commented Apr 13, 2017

@cpuguy83 @thaJeztah Patch updated to be driven by logrus's log level

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

Sorry about the long wait time for a review here, just a minor change and I think we'll be good to move forward.


// Working "notice" level into mappings as that is not a direct mapping for logrus log levels.
var logFunc = []func(format string, args ...interface{}){
logrus.Infof,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There shouldn't be a need to pull in logrus into this package.
Instead we can do the conversion in the devicmapper graphdriver package to devmapper levels defined in this package.

@cyphar
Copy link
Copy Markdown
Contributor

cyphar commented Jun 27, 2017

I'm going to cherry-pick and modify-as-necessary this into #33845. @jwhonce if you're still looking at this patch please feel free to review it as well.

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Jul 4, 2017

Thanks @cyphar

@cpuguy83 cpuguy83 closed this Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants