Log4j, different applications, the same package and a separate class, write to different files?

I usually associate a package with an application. But in this case, this class writes a lot of magazines, which I want to filter in another application. But the class is in the same package as my other classes.

I am trying to do this:

log4j.logger.com.app=DEBUG,MainAppender
log4j.logger.com.app.webservice.Web=DEBUG,WSAppender

I want WSAppender to write to a single file, but I DO NOT want the same logs from MainAppender. Right now, logs from WSAppender are also displayed in MainAppender.

+3
source share
1 answer

You need to set addild = false on the child registrar.

See an example here .

log4j.additivity.com.app.webservice.Web = false
+7
source

All Articles