#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.ejb;

import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoggerProducer {
 
    @Produces
    public Logger getLogger(InjectionPoint injectionPoint) {
        return LoggerFactory.getLogger(
                              injectionPoint.getBean().getBeanClass());
    }
    
}
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.ejb;

import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LoggerProducer {

    @Produces
    public Logger getLogger(InjectionPoint injectionPoint) {
        Class<?> clazz;
        if (injectionPoint.getBean() != null) {
            clazz = injectionPoint.getBean().getBeanClass();
        } else {
            clazz = injectionPoint.getMember().getDeclaringClass();
        }
        return LoggerFactory.getLogger(clazz);
    }
}
Fix Logger injection in GlassFish 4
Fix Logger injection in GlassFish 4

Signed-off-by: Fred Bricon <3278c038c93c729ae96f0d035919e3fb69e9cff7@gmail.com>
