Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure logback by excluding sub package?

Tags:

logback

I have packaging structre like beow

Packages

com.service.main
com.service.validation
com.service.subscriber
com.data.a
com.data.b
com.data.c

I want to create 3 appenders one for all data.* one for all service.* (except subscriber) one for all service.subscriber

I cannot use root here

like image 687
Aniket Avatar asked Mar 13 '23 21:03

Aniket


1 Answers

Just add separate logger for this package and set additivity flag.
Documentation.

More concrete logger will be triggered. Other loggers will ignore this package as you have more specific (and with turned off "additivity").

like image 60
Zakhar Avatar answered May 14 '23 22:05

Zakhar