Note that there are some explanatory texts on larger screens.

plurals
  1. POShould a Log4J logger be declared as transient?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COA couple of questions you could ask your self and add as edit to your question. What is your thought for and against making it transient? What does transient mean?
      singulars
    2. COI should have mentioned, I like the idea of having a logger for each instance rather than one for each class. I would have many instances of the same class instantiated and managed by a container (say a Spring application context) and would like to switch logging levels on a per-bean basis rather than on a per-class basis. In the example of a Spring application context, the logger would be declared as something like private final transient Logger log = Logger.getLogger(getBeanName()); where the bean is no longer a POJO and implements BeanNameAware
      singulars
    3. COSee also [the SLF4J FAQ](http://www.slf4j.org/faq.html#declared_static): *"Should Logger members of a class be declared as static? [...] In summary, declaring logger members as static variables requires less CPU time and have a slightly smaller memory footprint. [...] However, instance variables make it possible to create a distinct logger environment for each application, even for loggers declared in shared libraries. Perhaps more important than previously mentioned considerations, instance variables are IOC-friendly whereas static variables are not."*
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload