Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Trim the JSON logged for Kubernetes objects by weave-npc #3183

Merged
merged 1 commit into from
Jan 6, 2018
Merged

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Nov 22, 2017

Log size of weave-npc was getting out of hand. We currently run at debug level by default, which includes a full JSON dump of every Kubernetes objects received.

Remove things like "args" and "env" which bulk the logs, aren't relevant to the function of weave-npc, and may include sensitive information.

Use a black-list rather than a white-list because we can't be sure what information will be necessary in future.

Remove things like "args" and "env" which bulk the logs, aren't
relevant to the function of weave-npc, and may include sensitive
information.

Use a black-list rather than a white-list because we can't be sure
what information will be necessary in future.
a, _ := json.Marshal(v)
// Convert this back into a tree of key-value maps
var m map[string]interface{}
if err := json.Unmarshal(a, &m); err != nil {

This comment was marked as abuse.

This comment was marked as abuse.

@bboreham bboreham changed the base branch from master to 2.1 November 22, 2017 13:52
@bboreham bboreham modified the milestones: 2.1.2, 2.2 Nov 27, 2017
@brb
Copy link
Contributor

brb commented Jan 6, 2018

LGTM

@brb brb merged commit 6c5dd75 into 2.1 Jan 6, 2018
@bboreham bboreham deleted the trim-npc-json branch December 24, 2018 12:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants