[英]Log4j2 XML system file separator
Is there a way in the log4j2.xml file to use the OS's file separator when creating paths. 创建路径时,log4j2.xml文件中是否可以使用操作系统的文件分隔符。 I know in Java this can be referenced by File.separator. 我知道在Java中可以由File.separator引用。 I haven't seen a way to this in the log4j2 configuration docs. 在log4j2配置文档中,我还没有看到解决此问题的方法。 Thanks. 谢谢。
You may have a solution looking for a problem. 您可能有解决问题的方法。 I use "/" in all my Log4J configurations, Win, Mac or Linux, with no issues at all. 我在所有Log4J配置(Win,Mac或Linux)中都使用“ /”,完全没有问题。 Naturally, "\\" doesn't work on the latter two. 自然,“ \\”对后两个不起作用。
Try This ${sys:file.separator} 试试这个$ {sys:file.separator}
https://github.com/mulesoft/HowTo-Series-Examples/blob/master/aggregate-api-howto_1.0.0/src/main/resources/log4j2.xml https://github.com/mulesoft/HowTo-Series-Examples/blob/master/aggregate-api-howto_1.0.0/src/main/resources/log4j2.xml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.