How to configure gradle to use different log4j.properties files in different environments?

I have 3 profiles local, dev, prod profiles and 3 different log4j.properties files. How to configure gradle to use different properties files? If is it possible to do something similar to maven http://stackoverflow.com/questions/9543219/how-to-configure-maven-to-use-different-log4j-properties-files-in-different-envi ?