/*
 * Copyright () 2012 The Johns Hopkins University Applied Physics Laboratory.
 * All Rights Reserved.  
 */
package org.rapidandroid;

import org.apache.log4j.Logger;

import de.mindpipe.android.logging.log4j.LogConfigurator;
/**
 * SOURCE: http://muratonnet.com/index.php/2012/02/29/use-log4j-in-android/
 * @author Murat Aras
 *
 */
public class Log4jHelper {
	 
    private final static LogConfigurator _logConfigurator = new LogConfigurator();
 
    public static void Configure(String fileName, String filePattern,
            int maxBackupSize, long maxFileSize) {
 
        // set the name of the log file
        _logConfigurator.setFileName(fileName);
        // set output format of the log line
        _logConfigurator.setFilePattern(filePattern);
        // Maximum number of backed up log files
        _logConfigurator.setMaxBackupSize(maxBackupSize);
        // Maximum size of log file until rolling
        _logConfigurator.setMaxFileSize(maxFileSize);
        // Use LogCat appender
        _logConfigurator.setUseLogCatAppender(true);
        
        // configure
        _logConfigurator.configure();
 
    }
 
    public static Logger getLogger(String name) {
        Logger logger = Logger.getLogger(name);
        return logger;
    }
 
}
@@ -324,16 +324,553 @@
 at Aras%0A
+ * %0A * Example Usage:%0A %09%09Logger mLog = Logger.getLogger(RapidAndroidApplication.class);%0A%0A %09%09// write some logs%0A%09%09mLog.error(%22This is an error%22);%0A%09%09mLog.info(%22This is an info%22);%0A%09%09mLog.warn(%22This is a warn%22);%0A%09%09 %0A%09%09// write some exception%0A%09%09try %7B%0A%09%09    String dummyString = null;%0A%09%09    if (dummyString.equals(%22something%22)) %7B%0A%09%09        int dummyInt = 1;%0A%09%09    %7D%0A%09%09%7D catch (Exception ex) %7B%0A%09%09    mLog.error(ex.toString(), ex);%0A%09%09%7D%0A%09%09%0A%09%09String replytxt = ApplicationGlobals.getParseInProgressText();%0A%09%09mLog.info(%22reply text = %22 + replytxt);%0A
  *%0A */%0Ap

add enhanced system health logging to external file