import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class ExampleClass { private static final Logger logger = LogManager.getLogger(ExampleClass.class); public void exampleMethod() { if (logger.isDebugEnabled()) { logger.debug("Debug message: " + someVariable); } // other code } }In this example, we have created a `Logger` object using the `LogManager` class from the `org.apache.logging.log4j` package. Then, we have used the `isDebugEnabled` method to check whether the logging level is set to debug and printed the debug message if it is. The `org.apache.logging.log4j` package is a logging framework that provides a complete and advanced logging functionality for applications. The library provides features such as rolling logs, configuration files, and layout customization.