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

glog currently doesn't support passing configuration via environment variables #506

Closed
vivianforzj opened this issue Jan 17, 2020 · 4 comments · Fixed by #748
Closed

glog currently doesn't support passing configuration via environment variables #506

vivianforzj opened this issue Jan 17, 2020 · 4 comments · Fixed by #748
Labels
area/feature New feature or request
Milestone

Comments

@vivianforzj
Copy link

Summary

Kong Ingress controller version
0.7.0

Kong version
1.4

Kubernetes version

Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:26:52Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.8", GitCommit:"211047e9a1922595eaa3a1127ed365e9299a6c23", GitTreeState:"clean", BuildDate:"2019-10-15T12:02:12Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}

What happened

I want kong ingress controller to write logs to files. So according to https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/references/cli-arguments.md, I modify the ingressController env settings in the kong values.yaml as followings:

ingressController:
  enabled: true
  image:
    repository: kong-docker-kubernetes-ingress-controller.bintray.io/kong-ingress-controller
    tag: 0.7.0

  # Specify Kong Ingress Controller configuration via environment variables
  env:
    LOG_DIR: /var/log/ingress_controller
    LOGTOSTDERR: false
    ALSOLOGTOSTDERR: false
    STDERRTHRESHOLD: "2"
    V: 0

and when I descirbed the kong pod, I saw the following env for ingress-controller container:

    Environment:
      POD_NAME:                    r-kong-kong-5444b7fdc4-h7ksw (v1:metadata.name)
      POD_NAMESPACE:               default (v1:metadata.namespace)
      CONTROLLER_ALSOLOGTOSTDERR:  false
      CONTROLLER_LOGTOSTDERR:      false
      CONTROLLER_LOG_DIR:          /var/log/ingress_controller
      CONTROLLER_STDERRTHRESHOLD:  2
      CONTROLLER_V:                0

but the logs are still writen to stdout rather than to file.

Expected behavior

The kong ingress-controller logs are written to file.

@artburkart
Copy link
Contributor

Similarly, I can confirm it doesn't respect CONTROLLER_V: 3.

@hbagdi hbagdi added the area/feature New feature or request label Mar 6, 2020
@hbagdi
Copy link
Member

hbagdi commented Mar 6, 2020

Please instead use CLI args until this is addressed.
A PR to add support to add CLI args in Helm chart is welcome!

@artburkart
Copy link
Contributor

artburkart commented Mar 6, 2020

Yeah, I'll probably follow up with one, since log verbosity can't currently be configured through the Helm chart because of this.

hbagdi added a commit that referenced this issue Jun 26, 2020
This commit uses logrus to implement structured logging throughout the
repository.

Two new flags have been introduced for managing logging: `--log-level`
and `--log-format`.

Fix #712
Fix #506
hbagdi added a commit that referenced this issue Jul 8, 2020
This commit uses logrus to implement structured logging throughout the
repository.

Two new flags have been introduced for managing logging: `--log-level`
and `--log-format`.

Fix #712
Fix #506
hbagdi added a commit that referenced this issue Jul 8, 2020
This commit uses logrus to implement structured logging throughout the
repository.

Two new flags have been introduced for managing logging: `--log-level`
and `--log-format`.

Fix #712
Fix #506
hbagdi added a commit that referenced this issue Jul 9, 2020
This commit uses logrus to implement structured logging throughout the
repository.

Two new flags have been introduced for managing logging: `--log-level`
and `--log-format`.

Fix #712
Fix #506
From #748
@hbagdi hbagdi added this to the 0.10.0 milestone Sep 11, 2020
@hbagdi
Copy link
Member

hbagdi commented Sep 11, 2020

We have removed glog and replaced it with logrus and allow users to configure logging configuration via environment variables now.
This is shipping as part of 0.10 release in a couple of weeks.

@hbagdi hbagdi closed this as completed Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants