-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 ability to customize upstream and stream log format #352
Conversation
Coverage decreased (-0.04%) to 45.73% when pulling 60080d3e101e42f86a3cf22ba3ccdb177323ef0f on gianrubio:customize-logformat into 376519e on kubernetes:master. |
@gianrubio please set the default value like the ssl ciphers (to avoid the if else logic in the template) |
@aledbf I can do this for LogFormatStream but not for LogFormatUpstream. Because this var has an if condition
|
@gianrubio add all the content in the string and add a comment saying that is a golang template because of the conditional variables. If this introduce issues we can iterate and change in a future PR |
b0e9b11
to
d61fe32
Compare
@aledbf I already did your first suggestion, could you review again? |
/lgtm |
b13f3f4
to
19a791d
Compare
@aledbf I tried to push the code again because the test was receiving a 504 from coveralls. But looks like travis has some problem after the s3 outage. |
19a791d
to
15afcff
Compare
15afcff
to
0ca3aef
Compare
@gianrubio thanks! |
Hey @gianrubio, I'm looking exactly for something like this, as I need to customize my log format to contain also the namespaces :) Do you have the docs for this anywhere? (changing the logFormat in configMap). Thanks!! cc @mrrandrade @jcmoraisjr |
@rikatz this is my current log format. I'm using json as output so fluentd doesn't need to parse the log.
Are you interested to log the current ingress namespace? So just hardcode the value. Ex:
Otherwise you can log the upstream (that contains the namespace in the name) using the Ex :
|
@gianrubio yeah, this is nice. I was missing this in the [docs] (https://github.com/kubernetes/ingress/blob/5d17c7cc173b93be216ad70da22307d048494b63/controllers/nginx/configuration.md#allowed-parameters-in-configuration-configmap) so I've asked here as I didn't know the right parameter :D I'll think in something here, like defining a 'set' directive with the namespace inside each vhost, and then this could be used in the logging. But this needs some code change, and I don't know whether this is good or not to ingress. But will try to figure out here. Thanks!!! |
No description provided.