我想在同一文件上为差异级别配置不同的模式 例如
信息或调试我不需要显示文件名或行号
conversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c - %m %n
警告或致命 - 我需要显示文件名或行号
ConversionPattern=%d{%m/%d/%y %H:%M:%S} [%t] %-5p %c{2} %%%x%% - %m [%l]%n
怎么做?
最佳答案
当前版本的 log4cplus 不支持该功能。通过使用 log level filters 的两个不同的附加程序,您可以获得类似的效果。 attached .
关于logging - 为不同的日志级别配置 log4cplus ConversionPattern,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21014554/