Since I started to use XRebel, I was wondering about the following:
We started replacing our logger (SLF4J) fields from:
private static final Logger log = LoggerFactory...;
to
@Inject
private Logger log;
with a respective @Produces
producer.
This works fine in general, but I was wondering about the size of @SessionScoped
beans. They now always have an own logger, adding - according to XRebel - about 900k to every single one of the beans.
Now, the SLF4J LoggerFactory.getLogger(Class clazz)
does, according to the docs,
Return a logger named corresponding to the class passed as parameter, using the statically bound ILoggerFactory instance
But I am not exactly sure, how this plays together.
So my question is: does the container really have one logger in every instance of every session bean, producing quite some overhead in session size, or is it safe to use the @Inject
variant without producing all that overhead?