我使用基于 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
我不想在日志文件的第一行添加注释。