jetstack / kube-lego

DEPRECATED: Automatically request certificates for Kubernetes Ingress resources from Let's Encrypt
Apache License 2.0
2.16k stars 267 forks source link

Add ability to log in json #215

Closed n1koo closed 7 years ago

n1koo commented 7 years ago

Adds ability to change logformat in logrus.json is super useful for people using eg. Splunk or Logstash.

Configuration stanza is the default from https://github.com/sirupsen/logrus/blob/3d4380f53a34dcdc95f0c1db702615992b38d9a4/README.md#L22

Default to text if no other value is given, but error and exit on non-supported values.

munnerz commented 7 years ago

Thanks for this - my only nit: can we fail if an invalid log format is specified, rather than fall back to text? If a user has explicitly set a log format that is invalid, I think it makes sense to inform them that their chosen format is invalid :)

n1koo commented 7 years ago

@munnerz fair point, I changed it to default to text on empty ENV but any non-valid value errors and exits