title: Location log4j.properties file in gradle build system
body: <p>I am able to build my simple java app using log4j2.  However, when I run the app, I get the following error message:</p>
  
  <pre><code>$ gradle run
  :compileJava UP-TO-DATE
  :processResources UP-TO-DATE
  :classes UP-TO-DATE
  :run
  ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
  </code></pre>
  
  <p>I am using gradle build system.  I put the file - log4j.properties in "src/main/resources/" directory.</p>
  
  <pre><code>$ cat src/main/resources/log4j.properties 
  
  log=/home/aalmehdi/temp/javatut/gradle-demo
  
  # Define the root loogger with appender
  log4j.rootlogger=DEBUG, stdout, KPLOGFILE
  
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n
  
  log4j.appender.KPLOGFILE=org.apache.log4j.FileAppender
  log4j.appender.KPLOGFILE.File=${log}/kplog.out
  log4j.appender.KPLOGFILE.layout=org.apache.log4j.PatternLayout
  log4j.appender.KPLOGFILE.layout.conversionpattern=%m%n
  
  log4j.logger.kplogger=DEBUG, KPLOGFILE
  </code></pre>
  
  <p>Can someone please help.</p>
  
  <p>Thank you,
  Ahmed.</p>