lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/internal/FileLogger.java
public synchronized void log(final JSONObject logData, String fileName) throws SecurityException, IOException {
        if (null != singleton) {
            filePath = context.getFilesDir () + System.getProperty("file.separator") + fileName;
            FileHandler handler = null;
            handler = new FileHandler(filePath, LogPersister.getMaxLogStoreSize(), LogPersister.MAX_NUM_LOG_FILES, true);
            handler.setFormatter(formatter);
            singleton.addHandler (handler);
            singleton.log (Level.FINEST, logData.toString() + ",");

            singleton.getHandlers()[0].close();
            singleton.removeHandler (handler);
        }

    }
public synchronized void log(final JSONObject logData, String fileName) throws SecurityException, IOException {
        if (null != singleton) {
            filePath = context.getFilesDir () + System.getProperty("file.separator") + fileName;
            FileHandler handler = null;
            handler = new FileHandler(filePath, LogPersister.getMaxLogStoreSize(), LogPersister.MAX_NUM_LOG_FILES, true);
            handler.setFormatter(formatter);
            singleton.addHandler (handler);
            singleton.log (Level.FINEST, logData.toString() + ",");

            singleton.getHandlers()[0].close();
            singleton.removeHandler (handler);
        }

    }
public synchronized void log ( final JSONObject logData , String fileName ) throws SecurityException , IOException { if ( null != singleton ) { filePath = context . getFilesDir ( ) + System . getProperty ( "file.separator" ) + fileName ; FileHandler handler = null ; handler = new FileHandler ( filePath , LogPersister . getMaxLogStoreSize ( ) , LogPersister . MAX_NUM_LOG_FILES , true ) ; handler . setFormatter ( formatter ) ; singleton . addHandler ( handler ) ; singleton . log ( Level . FINEST , logData . toString ( ) + "," ) ; singleton . getHandlers ( ) [ 0 ] . close ( ) ; singleton . removeHandler ( handler ) ; } }
Callers should pass a JSONObject in the format described in the class-level documentation.  It will be
placed as-is, using JSONObject.toString(), with no additional contextual information automatically appended.
We use java.util.logging simply to take advantage of its built-in thread-safety and log rollover.

@param logData JSONObject, placed in log file as-is using JSONObject.toString()
@throws IOException
@throws SecurityException
Callers should pass a JSONObject in the format described in the class - level documentation . It will be placed as - is using JSONObject . toString () with no additional contextual information automatically appended . We use java . util . logging simply to take advantage of its built - in thread - safety and log rollover .