What access level should the recorders be set to?

I am using SLF4J with Log4J stand. What access levels should I set for my registrars?

static final Logger logger = LoggerFactory.getLogger(ClassName.class);

      

+2


source to share


2 answers


I think you should use an access level private

because each class should have its own copy of the log. If not, we cannot tell which class actually made the log entry.



+11


source


I've always put them in my personal. Is there any reason why some other class needs access to this logger?



+2


source







All Articles