Answer the question
In order to leave comments, you need to log in
What is the correct way to make (initialize) a logger in Java?
Hello everyone! I'm making a plug-in for something in Java.... And I need to figure out how to make Logger (java.util.logging) better and more correctly?
On different resources (namely Habr, GitHub and my "mega" research) I saw a small bunch of ways:
1) It seems that it did not work for me ... But I need to double-check (Oh, yes. I use IntellijIdea) . Taken from habr .
private static Logger log = Logger.getLogger(SomeClass.class.getName());
private static final Logger logger = Logger.getLogger(SomeClass.class.getCanonicalName());
private static final Logger logger = Logger.getLogger("");
(just empty, that's the best thing, isn't it?) (SARK!1)
Answer the question
In order to leave comments, you need to log in
Any of these.
https://projectlombok.org/features/log
I am using @Log4j
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question