开发者

how to write log into formatted folders using Boost.Log?

开发者 https://www.devze.com 2023-03-01 18:18 出处:网络
Boost.Log supports configurable file name, e.g. %Y_%m_%d_sample_%N.log. What I want is put them in diff开发者_运维知识库erent folders, say, \"%Y_%m_%d/sample_%N.log\", but it created a folder named \"

Boost.Log supports configurable file name, e.g. %Y_%m_%d_sample_%N.log. What I want is put them in diff开发者_运维知识库erent folders, say, "%Y_%m_%d/sample_%N.log", but it created a folder named "%Y_%m_%d", while I'm expecting "2011_05_02"(for the date I'm trying), do you know how to get what I want ? Thanks


It can't do this as it requires creating directories. Basically you can't create file dynamically in a non-existant directory at the OS level. That is why it parses the name you've configured and reuses dynamic template only for a filename and not for a directory. What you can do instead is probably to move those files to corresponding directories using few shell commands from a crontab.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号