更新时间:2023-01-06 15:17:00
基于您对我的评论的回复,我非常喜欢您的想法,并且可以看到它会非常有用.据我所知,log4j 1.X没有提供将当前配置作为属性文件转储的功能.我很确定只实现了反序列化-从属性到内存中的对象,而不是相反.
Based on your reply to my comment I really like your idea and I can see how it would be very useful. To my knowledge there is no feature provided by log4j 1.X that will dump the current config as a properties file. I'm pretty sure only the deserialization has been implemented - going from properties to objects in memory not vice versa.
Take for example a ConsoleAppender
- if we look at the javadoc there is nothing to indicate that it is serializable or capable of dumping its configuration in any way let alone as properties.
想到了两个选项,它们是:
Two options come to mind and they are:
OR
希望这会有所帮助!