【问题标题】:cadvisor - how to reduce the number of logscadvisor - 如何减少日志数量
【发布时间】:2019-12-18 19:16:48
【问题描述】:

我们喜欢使用“顾问”进行监控。

如何提高日志记录级别以减少记录的数据量?

我阅读了有关“-v=0”命令参数的信息,但找不到更多文档。

【问题讨论】:

    标签: cadvisor


    【解决方案1】:

    cAdvisor 的日志记录取自 glog。如果您通过其他一些存储库跟踪 cmets,您最终会到达这里:https://github.com/google/glog/blob/master/doc/glog.html

    对你来说重要的部分是:

    INFOWARNINGERRORFATAL 的严重级别数分别为 0123

    因此使用相应设置的-v 标志来清理您的日志文件

    【讨论】:

    • 好吧,考虑到默认值为 0,我怀疑这是问题所在,但我们会看到。
    • 如果默认值为零,则将其更改为 1、2 或 3 应该会减少记录的内容数量。如果我正确阅读问题,他们希望减少日志记录,这通常意味着放弃信息和可能的警告日志。即设置-v=2
    • 正确,这就是为什么我在答案中将--v=0 更改为--v=1,但没有办法减少数字,只有严重性报告。
    • 我想这本来会减少数字,但你明白我的意思。
    【解决方案2】:

    你可以试试:

    --log_dir="" #: If non-empty, write log files in this directory
    --logtostderr=false #: log to standard error instead of files
    --alsologtostderr=false #: log to standard error as well as files
    --stderrthreshold=0 #: logs at or above this threshold go to stderr
    --v=1 #: log level for V logs
    --vmodule= #: comma-separated list of pattern=N settings for file-filtered logging
    

    但根据GitHub documentation,目前没有办法这样做。

    【讨论】:

    • --v=1 应该增加发送错误所需的阈值
    猜你喜欢
    • 1970-01-01
    • 2023-01-16
    • 1970-01-01
    • 2018-02-07
    • 1970-01-01
    • 1970-01-01
    • 2012-03-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多