Q:

log4j2.properties set logger level to many packages

AFAIK the logger level for a package/class in log4j2 properties file should be set like below. 
loggers = abc
logger.abc.name = com.abc. MyClass
logger.abc.level = INFO

So if I have 50 classes/packages to specify, does it mean I have to have 50 entries in loggers and 50 of entries for each name and level. 
Is not there an alternative way to do it with one line for each logger so it can be done in 50 lines? 

A:

You can specify the logging... for each package.  Like this:
logger.mongodb.name = org.mongodb.driver
logger.mongodb.level = warn

logger.ehcache.name = org.ehcache.core
logger.ehcache.level = warn

