title: Read a file line by line in reverse order
body: <p>I have a java ee application where I use a servlet to print a log file created with log4j. When reading log files you are usually looking for the last log line and therefore the servlet would be much more useful if it printed the log file in reverse order. My actual code is:</p>
  
  <pre><code>    response.setContentType("text");
      PrintWriter out = response.getWriter();
      try {
          FileReader logReader = new FileReader("logfile.log");
          try {
              BufferedReader buffer = new BufferedReader(logReader);
              for (String line = buffer.readLine(); line != null; line = buffer.readLine()) {
                  out.println(line);
              }
          } finally {
              logReader.close();
          }
      } finally {
          out.close();
      }
  </code></pre>
  
  <p>The implementations I've found in the internet involve using a StringBuffer and loading all the file before printing, isn't there a code light way of seeking to the end of the file and reading the content till the start of the file?</p>