POCO::Logger 在日志文件的第一行写入注释

问题描述 投票:0回答:1

我使用基于 C++ 的 Docker 容器并实现 POCO::Logger 进行日志记录。并且,日志文件每 5 分钟轮换一次。 POCO::Logger 在第一行添加注释。我不希望在日志文件的第一行出现此注释,如何删除它? POCO 是否提供任何方法/配置来实现相同的目的?

poco.log

# Log file created/rotated Friday, 15 Nov 24 11:48:17 GMT
{ "@timestamp":"2024-11-15T11:48:17.490Z","log":{"level":"Information"}, "container":{"name":"testrsk","id":"dlp-testrsk-1.2.500-746f5748cc-mfdz4"}, "labels": {"Description":"Statistical Information Per Event","EventClassID":"EventStats","Severity":"Medium","autoguid":"013e2e4b-0e04-44bc-9ff9-0bf901c80d6d","direction":"read","dlpseverity":"WARNING","eventglobalid":"unknown","failed":"no","source":"[\"dxl://kfk-dev-kafka-0.kfk-dev-kafka-headless.dev-epoeksdatabus.svc.cluster.local:9092,kfk-dev-kafka-1.kfk-dev-kafka-headless.dev-epoeksdatabus.svc.cluster.local:9092,kfk-dev-kafka-2.kfk-dev-kafka-headless.dev-epoeksdatabus.svc.cluster.local:9092/kafka.raw/group0/0\"]","tenant":"0A85E628-EAB7" ,"autoid":8,"dlpeventid":100} }

poco 配置文件:

rsk_logging:
    event:
        level: critical
    message:
        level: information
        rotation: 5minutes
        count: 10
        archive: timestamp
        flush: false
    stats:
        level: information
        rotation: 5minutes
        count: 10
        archive: timestamp
        flush: false
    logfile: /shared/logs/rsk

我不想在日志文件的第一行添加注释。

c++ logstash poco-libraries
1个回答
0
投票

不。轮换消息是“无条件”写入的,至少在撰写本文时是这样。当然,您始终可以编辑代码和/或提交拉取请求。

© www.soinside.com 2019 - 2024. All rights reserved.