开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜