|
This rule detects the use of weblogic.logging.LoggingHelper
to obtain a logger. The automated fix will replace the call to obtain a logger from
weblogic.logging.LoggingHelper
with a call to obtain a logger from
java.util.Logger.
|
- The use of the LoggerHelper to obtain a server logger:
Logger serverlogger = LoggingHelper.getServerLogger();
- The use of the LoggerHelper to obtain a client logger:
Logger clientlogger = LoggingHelper.getClientLogger();
- The use of the LoggerHelper to obtain a Domain Logger example:
Logger domainlogger = LoggingHelper.getDomainLogger();
First you will need to replace the LoggingHelper with
java.util.Logger.
For the previous examples, assuming the class name is MyTest, The automated fix will produce the following results:
Logger serverlogger = Logger.getLogger(MyTest.class.getName());
Logger clientlogger = Logger.getLogger(MyTest.class.getName());
Logger domainLogger = Logger.getLogger(MyTest.class.getName());
The MyTest class might not already contain an
import statement for the logger; for example:
- import java.util.logging.Logger; or
- import java.util.logging.*;
In this case, the modification is qualified as:
-
java.util.logging.Logger.getLogger(MyTest.class.getName());