Implement External Logger Object
User can create own custom logger object by implementing the IngrianLogService
interface.
Set the above created logger object on application level as below:
Here, CustomLogger
object implements all the common logging methods such as debug, info, trace, and error of IngrianLogService
interface.
Note
If Custom Logger object is used, the default internal logging of CADP for Java will be disabled.
How to use external logger object
The following steps describe how to upgrade the existing log4j jar files or how to use any other logging framework jar files:
Remove the existing log4j jar files (log4j-core-2.17.2.jar and log4j-api-2.17.2.jar) from the classpath.
Add the new logger framework jar files and the implementation of the external logger object in the classpath. For example, to use
slf4j
as external logger, add the followingslf4j
logging framework jar files in the classpath:slf4j-simple-1.7.9.jar
slf4j-api-1.7.9.jar
logback-core-1.2.3.jar
logback-classic-1.2.3.jar
Pass the custom logger object to the Ingrian Provider: