user1558837
user1558837

Reputation: 11

Setting log levels for all classes in log4j

Is there a way to set log levels for all classes in a package in log4j? I don't want to add a line for each class in my package in log4j.properties

So if I have a package such as : com.my.package and class1, class2, class3 in that package , is there a concise way to set

log4j.logger.com.my.package.class1=INFO
log4j.logger.com.my.package.class2=INFO
log4j.logger.com.my.package.class3=INFO

I tried:

log4j.logger.com.my.package.*=INFO but that does not seem to work.

Thanks.

Upvotes: 0

Views: 299

Answers (1)

Olivier.Roger
Olivier.Roger

Reputation: 4229

Try log4j.logger.com.my.package=INFO

Upvotes: 1

Related Questions