Skip to content

Commit ef5d38e

Browse files
committed
Produce loggers for the declaring class instead of the bean class
1 parent 8c844f3 commit ef5d38e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/net/kautler/command/LoggerProducer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import javax.enterprise.inject.spi.InjectionPoint;
2525

2626
/**
27-
* A CDI producer that produces log4j loggers for the bean class of the injection point.
27+
* A CDI producer that produces log4j loggers for the declaring class of the injection point.
2828
*/
2929
@ApplicationScoped
3030
class LoggerProducer {
@@ -35,14 +35,14 @@ private LoggerProducer() {
3535
}
3636

3737
/**
38-
* Returns a newly produced log4j logger for the bean class of the given injection point.
38+
* Returns a newly produced log4j logger for the declaring class of the injection point.
3939
*
4040
* @param injectionPoint the injection point for which to produce a log4j logger
41-
* @return a newly produced log4j logger for the bean class of the given injection point
41+
* @return a newly produced log4j logger for the injection point
4242
*/
4343
@Produces
4444
@Internal
4545
private Logger getLogger(InjectionPoint injectionPoint) {
46-
return LogManager.getLogger(injectionPoint.getBean().getBeanClass());
46+
return LogManager.getLogger(injectionPoint.getMember().getDeclaringClass());
4747
}
4848
}

0 commit comments

Comments
 (0)