【问题标题】:AsyncAppender in log4j.properties filelog4j.properties 文件中的 AsyncAppender
【发布时间】:2017-02-11 14:35:39
【问题描述】:

我遇到了一些麻烦,即使我已经搜索了答案,但仍然找不到。

为了使用 AsyncAppender,我见过很多不同的 log4j 配置,无论如何,它们都与 .properties 配置文件无关。

我自己尝试了不同的配置,但在尝试将 asyncAppender 与 SocketAppender 一起使用时完全没有成功。

AsyncAppender可以在.properties文件上配置,还是需要通过code/xml配置?

提前致谢!

【问题讨论】:

    标签: properties log4j asyncappender


    【解决方案1】:

    答案是:不,没有办法通过属性文件进行配置。

    AsyncAppender需要通过code/xml配置。

    :)

    【讨论】:

    • 你是如何通过代码来实现的?我只能通过 XML 找到
    • @DavidBrossard 我有点晚了(一年左右),请阅读。我的意思是类似于此链接上的第二个示例:programcreek.com/java-api-examples/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-08
    • 1970-01-01
    • 2015-09-15
    • 1970-01-01
    相关资源
    最近更新 更多