Found answer from here
Had to change from
PropertyConfigurator.configure("log4j.properties");
to this
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
PropertyConfigurator.configure(classLoader.getResource("log4j.properties"));
Another solution is to hard code the path of the log4j.properties file but I dont recommend it:
PropertyConfigurator.configure("C:/User/...../log4j.properties");