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

Http access log is hard-coded to debug. Configuration log-level is useless #26

Open
hanynowsky opened this issue Jan 24, 2020 · 18 comments

Comments

@hanynowsky
Copy link

func NewHTTP(cfg *config.HTTPConfig) (*HTTP, error) {
        h := &HTTP{}
        h.cfg = cfg
        h.closing = make(chan bool, 1)
        //Log output

        h.log = utils.GetConsoleLogFormated(cfg.LogFile, cfg.LogLevel)
        //AccessLog Output

        h.acclog = utils.GetConsoleLogFormated(cfg.AccessLog, "debug")

        h.rp = cfg.DefaultRetentionPolicy
@like-inspur
Copy link

I set warn for log level, but doesn't effect on access-log

@toni-moreno
Copy link
Owner

hello @hanynowsky @like-inspur it is hard coded as debug because of access.log has not levels its main goal is print each incoming query with related data.

If you need disable you can select /dev/null as output file to write to. Could yo test please? Why do you think this log could be annoyance and should be disabled in configuration time?

@like-inspur
Copy link

because I run it on docker with image, if this log print forever, it will occupy docker disk in the future

@toni-moreno
Copy link
Owner

We could add a log option to redirect logs to the console... would you like this option better than separate files?

@like-inspur
Copy link

We could add a log option to redirect logs to the console... would you like this option better than separate files?

certainly, and this will be bettern to watch service log under docker environment, and hope to modify this for syncflux also

@toni-moreno
Copy link
Owner

Hi @like-inspur , I've just released the syncflux 0.6.7 version wit default logmode on console , and other fixes and updates. Could you test it please? , If all ok, we will try to fix and release a new influxb-srelay version with this and other fixes ASAP.
Thank you!

@like-inspur
Copy link

@toni-moreno I've just test syncflux 0.6.7 on my kubernetes environment and it works like below:
image

@toni-moreno
Copy link
Owner

it seems to be logging into the console ok.

NOTE: remember replication config "all" doesn't exist the correct config is "both" (ocumentation in previous versions was wrong)

@like-inspur
Copy link

@toni-moreno thank you very much, and waiting for your newest version of influxdb-srelay

@toni-moreno
Copy link
Owner

Hello @like-inspur I've just reviewed code and remembered that code was ready to log into console by only omit all log-file and access-log paràmeters.

# HTTP Server
[[http]]
  name = "http-influxdb"
  bind-addr = "0.0.0.0:9096"
  log-file = ""
  log-level = "debug"
  access-log = ""

or

# HTTP Server
[[http]]
  name = "http-influxdb"
  bind-addr = "0.0.0.0:9096"
  log-level = "debug"

Could you test please?

@like-inspur
Copy link

like-inspur commented May 12, 2020

@toni-moreno hello, above config is ok and can't effect on http_route_pass_all.log like below, sanme as syncflux(toni-moreno/syncflux#35), but output in console

root@mgt01:~# kubectl log influxdb-1 -n monitoring srelay
log is DEPRECATED and will be removed in a future version. Use logs instead.
{"level":"info","time":"2020-05-12T01:49:30Z","message":"trying to open log file /var/log/influxdb-srelay/http_route_pass_all.log ....."}
2020/05/12 01:49:30 starting relays...
2020/05/12 01:49:30 Running relay http-influxdbcluster...
2020-05-12 01:50:29 INF  bk_duration_ms=0.145692 duration_ms=0.167451 latency_ms=0.028479 method=GET referer= returnsize=4 source=10.110.19.68:47672 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:50:33 INF  bk_duration_ms=0.187114 duration_ms=0.255529 latency_ms=0.074831 method=GET referer= returnsize=4 source=10.110.19.68:47744 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:51:29 INF  bk_duration_ms=0.056033 duration_ms=0.066763 latency_ms=0.029602 method=GET referer= returnsize=4 source=10.110.19.68:48262 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:51:33 INF  bk_duration_ms=0.04309 duration_ms=0.066816 latency_ms=0.029657 method=GET referer= returnsize=4 source=10.110.19.68:48308 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:52:29 INF  bk_duration_ms=0.039261 duration_ms=0.060479 latency_ms=0.027422 method=GET referer= returnsize=4 source=10.110.19.68:48888 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:52:33 INF  bk_duration_ms=0.044126 duration_ms=0.066866 latency_ms=0.029269 method=GET referer= returnsize=4 source=10.110.19.68:48918 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:53:29 INF  bk_duration_ms=0.053366 duration_ms=0.086989 latency_ms=0.041293 method=GET referer= returnsize=4 source=10.110.19.68:49466 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-05-12 01:53:33 INF  bk_duration_ms=0.078931 duration_ms=0.144222 latency_ms=0.071531 method=GET referer= returnsize=4 source=10.110.19.68:49524 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0

@toni-moreno
Copy link
Owner

hi @like-inspur have you tested log-inherit=true on all route sections?

@like-inspur
Copy link

yes, I config like below but still output http log like above

        [[http.endpoint.route]]
          name="pass_all"
          # level:
          #   * http => all following rules will work only with http params
          #   * data => any of the following rules will need data inspection
          level="http" # http or data
          #log-inhit
          # true => will use the endpoint log as this route log
          # false => will use its own log file ,  if not set the name <logdir>/http_route_<route_name>.log
          log-inherit = true
          #log-file = "query_route_linux_metrics.log"
          log-level = "warn"

@toni-moreno
Copy link
Owner

Hello @like-inspur , I've just reviewed code and tested the above described config and it is working to me.

Please check that you have void all your log-file entries and you have log-inherit=true in all your routes.
I did it and all fine. ( 8 route entries one for each route)

# grep "\[\[http.endpoint.route\]\]" test/relay.devel.conf  | wc -l
8
 # grep "log-inherit" test/relay.devel.conf  | wc -l
8

please review and restart the process to test and let me know if finally fixed.

Thank you very much.

@like-inspur
Copy link

@toni-moreno I add log-inherit=true for each [[http.endpoint.route]] and there are 2 in my config
But still output log like above

@toni-moreno
Copy link
Owner

Please. Could you completely stop image, delete volumes and after restart again?

@like-inspur
Copy link

@toni-moreno yes,I update configmap and restart pod again, not mount any volume for pod

@like-inspur
Copy link

@toni-moreno hello, pod health check and prometheus write into influxdb log still always prrint like below
2020-09-04 06:28:38 INF bk_duration_ms=0.047086 duration_ms=0.06977 latency_ms=0.02909 method=GET referer= returnsize=4 source=10.110.19.68:43164 status=200 trace-route="http:http-influxdbcluster> " url=/health user=- user-agent=kube-probe/1.14 write-points=0 write-size=0
2020-09-04 06:27:27 INF bk_duration_ms=5.016989 duration_ms=6.828567 latency_ms=1.81905 method=POST referer= returnsize=0 source=100.101.63.105:51468 status=204 trace-route="http:http-influxdbcluster> rt:pass_all> decode:prom-write> rule:pass_all> " url=/write?db=prometheus user=- user-agent=Prometheus/2.15.2 write-points=100 write-size=25400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants