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

Improve request logging format #74

Closed
leakingtapan opened this issue Oct 22, 2018 · 0 comments
Closed

Improve request logging format #74

leakingtapan opened this issue Oct 22, 2018 · 0 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@leakingtapan
Copy link
Contributor

The logging format for each incoming request prints memory address within a struct if the request contains pointer. This will not be very useful during debugging. We could improve it to log concrete value.

Once example of CreateVolume request:

I1019 05:02:56.884487       1 controller.go:32] CreateVolume: called with args &csi.CreateVolumeRequest{Name:"pvc-2cf57f1d-d35c-11e8-81f1-0a75e9a76798", CapacityRange:(*csi.CapacityRange)(0xc00044c720), VolumeCapabilities:[]*csi.VolumeCapability{(*csi.VolumeCapability)(0xc0001b0640)}, Parameters:map[string]string(nil), ControllerCreateSecrets:map[string]string(nil), VolumeContentSource:(*csi.VolumeContentSource)(nil), AccessibilityRequirements:(*csi.TopologyRequirement)(0xc00035c870), XXX_NoUnkeyedLiteral:struct {}{}, XXX_unrecognized:[]uint8(nil), XXX_sizecache:0}

We cloud do similar logging as external-provisioner logging format for request/response. As an example:

I1022 16:50:32.235405       1 controller.go:432] CreateVolumeRequest {Name:pvc-8f552e58-d61a-11e8-81f1-0a75e9a76798 CapacityRange:required_bytes:4294967296  VolumeCapabilities:[mount:<> access_mode:<mode:SINGLE_NODE_WRITER > ] Parameters:map[] ControllerCreateSecrets:map[] VolumeContentSource:<nil> AccessibilityRequirements:requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1a" > > requisite:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1b" > > preferred:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1c" > > preferred:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1a" > > preferred:<segments:<key:"com.amazon.aws.csi.ebs/zone" value:"us-east-1b" > >  XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
@leakingtapan leakingtapan added this to the 0.3-beta milestone Oct 22, 2018
@leakingtapan leakingtapan added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

1 participant