Not sure what is the error as I cannot see the error.
You can add this to your pom.xml
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.16.0</version>
</dependency>
Import this on your class file
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
define your logger name
public class myclassname {
private static final Logger logger = LogManager.getLogger(myclassname.class)
use this method to call your logger
logger.error();