I am considering using CDI injection for slf4j logger, so I created a manufacturer.
I inject it into the ApplicationScoped bean, which is serializable:
@ApplicationScoped public final class CurrentApplicationBean implements Serializable { @Inject private transient Logger logger; }
It should be temporary because org.slf4j.Logger is an interface that does not extend Serializable , but that means the registrar must be re-injected after deserialization.
I think CDI is not up to the challenge, what do you know?
In addition, the provider always provides a new Logger beacuse instance, it must set the log name from InjectionPoint , which means that RequestScoped beans has its own log instance, and not static for each class registrar.
Maybe journaling is not a good context for CDI injections ... what are your thoughts?
source share