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

lightning: setting --log-file "-" will not print any log to stdout #29876

Closed
fengou1 opened this issue Nov 17, 2021 · 2 comments · Fixed by #29896
Closed

lightning: setting --log-file "-" will not print any log to stdout #29876

fengou1 opened this issue Nov 17, 2021 · 2 comments · Fixed by #29896
Labels
component/lightning This issue is related to Lightning of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@fengou1
Copy link
Contributor

fengou1 commented Nov 17, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. create a tidb cloud cluster
  2. import some data into cluster
  3. check Loki/ES by cluster ID and orgID
  4. lightning log been truncated

DBaaS run lightning by parameter: --log-file="-", issue can be reproduced in 5.3.0 env.

2. What did you expect to see? (Required)

After DBaaS import data done, Loki/ES shall able to show all lightning log.

3. What did you see instead (Required)

Loki/ES only show part of lightning log at very begin of lightning start.
DelnFP9KnC

4. What is your TiDB version? (Required)

/tmp # /tidb-lightning -V
Release Version: v5.3.0
Git Commit Hash: c83f032b04a40b3148dff712392dd924ae064132
Git Branch: heads/refs/tags/v5.3.0
Go Version: go1.16.4
UTC Build Time: 2021-11-16 11:54:51
Race Enabled: false
@fengou1 fengou1 added type/bug The issue is confirmed as a bug. severity/major component/lightning This issue is related to Lightning of TiDB. labels Nov 17, 2021
@kennytm kennytm changed the title lightning: DBaaS import succeed, however, log is not complete show in ES/loki lightning: setting --log-file "-" will not print any log to stdout Nov 17, 2021
@kennytm
Copy link
Contributor

kennytm commented Nov 17, 2021

this bug is introduced by #29291, which skips initializing logger when the log file is set to empty.

func initEnv(cfg *config.GlobalConfig) error {
if cfg.App.Config.File == "" {
return nil
}
return log.InitLogger(&cfg.App.Config, cfg.TiDB.LogLevel)
}

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/lightning This issue is related to Lightning of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants