import java.util.logging.Logger; public class MyClass { private static final Logger LOGGER = Logger.getLogger(MyClass.class.getName()); public void method() { // Some logic... if (diskSpace < 10) { LOGGER.log(Level.WARNING, "Low disk space: {0}", diskSpace); } // Some more logic... } }In this code snippet, we're using the LOGGER object to log a warning message if the disk space falls below 10 GB. The message includes a parameter that's passed to the LOGGER.log method at {0}. This parameter will be replaced with the corresponding value of diskSpace when the log is generated. The package that contains the LOG warn level is java.util.logging.