title: Get Log4j2 log file location to write to directory containing a date
body: <p>How can I get the location of a log4j log file? I tried this: <a href="https://stackoverflow.com/questions/3217296/where-can-i-programatically-find-where-the-log4j-log-files-are-stored">Where can i programatically find where the log4j log files are stored?</a> </p>
  
  <p>But it doesn't work for newer versions of log4j. </p>
  
  <p>I am creating the file with the system date inside it, but when I retrieve the path, the time stamp would have changed. </p>