Log4j2: Dynamic creation of log files for multiple logs

前端 未结 3 1067
挽巷
挽巷 2020-12-06 03:28

I am currently creating a system that can have modules (think of them as plugins), where each one of them can have their own log, dedicated.

I would like to use the

3条回答
  •  旧时难觅i
    2020-12-06 03:58

    I'm assuming you want your module management code define the logger configuration, right? If so, you may want to take a look at this portion of the manual which talks about extending LoggerConfig which based on what your asking is what I think you are looking for.

    http://logging.apache.org/log4j/2.x/manual/extending.html

    For what it's worth, I've been involved in large plug-in based systems before (using OSGi) and we honestly haven't taken this route. It's usually easier to just grep the class or package you are interested in from a single log file.

提交回复
热议问题