【发布时间】:2019-08-01 06:06:30
【问题描述】:
我使用 Poco::LoggingConfigurator 库进行日志记录,使用 Poco::XMLConfiguration 配置日志记录属性。我想在日志记录配置 xml 文件的路径值中使用环境变量。如何在xml配置文件中做到这一点?
这是我现在使用的xml配置文件。
<logging>
<channels>
<logFileChannel>
<class>FileChannel</class>
<path>/logs/agent-xfs.log</path>
<rotation>1 M</rotation>
<archive>timestamp</archive>
<compress>true</compress>
<purgeCount>60</purgeCount>
</logFileChannel>
</channels>
<loggers>
<root>
<channel>logFileChannel</channel>
<level>debug</level>
</root>
</loggers>
我想使用如下环境变量定义路径变量值,
${ENV_SAMPLE_VARAIBLE}/logs/agent-xfs.log
【问题讨论】:
标签: poco-libraries