title: extend Android.util.Log to write to file
body: <p>I would like to extend the <code>android.util.Log</code> class to also write to a log file in internal storage of the device, preferrably also for specific <code>TAGS</code>.</p>
  
  <p>I currently have an implementation:</p>
  
  <pre><code>public class CustomLogger{
  
  private final static Logger fileLog = Logger.getLogger(MainActivity.class);
  private Context context;
  
  public CustomLogger(Context c){
      this.context = c;
  
      final LogConfigurator logConfigurator = new LogConfigurator();
      logConfigurator.setFileName(context.getFilesDir() + File.separator + "myApp.log");
      logConfigurator.setRootLevel(Level.DEBUG);
      logConfigurator.setLevel("org.apache", Level.ERROR);
      logConfigurator.configure();
  }
  
  public void i(String TAG, String message){
  
      // Printing the message to LogCat console
      Log.i(TAG, message);
  
      // Write the log message to the file
      fileLog.info(TAG+": "+message);
  }
  
  public void d(String TAG, String message){
      Log.d(TAG, message);
      fileLog.debug(TAG+": "+message);
    }
   } 
  </code></pre>
  
  <p>As you can see this custom logger logs both to a log file on the internal storage (using the <code>android-logging-log4j</code> library) and through the <code>android.util.Log</code> class. 
  However i would like the standard log entries from the <code>android.util.Log</code> class in my log file, and if possible only certain (custom) <code>TAGS</code>.</p>
  
  <p>Anybody has an example or any good tips on how to reach this?</p>
  
  <p>Thanks in advance</p>