Export to GitHub

android-logging-log4j - issue #9

maxfileSize > 1MB ignored


Posted on Feb 9, 2015 by Quick Dog

What steps will reproduce the problem?

Initialize Log4J with this snippet:

static {
    configureLog4j();
}

private static void configureLog4j() {
    final File dir = new File(LOG_DIR);
    if(!dir.exists()) {
        dir.mkdir();
    }
    logger = Logger.getLogger(LOGGER_NAME);
    configure();
}

private static void configure( ) {
    logConfigurator.setFileName(FILE_NAME);
    logConfigurator.setMaxFileSize(MAX_FILE_SIZE);
    logConfigurator.setFilePattern(LOG_PATTERN);
    logConfigurator.setMaxBackupSize(MAX_BACKUP_FILE_COUNT);
    logConfigurator.setRootLevel(LOGGING_LEVEL);
    setLoggingLevels(LOGGING_LEVEL.toInt());
    logConfigurator.setUseLogCatAppender(true);
    logConfigurator.setUseFileAppender(true);
    logConfigurator.configure();
}

where MAX_FILE_SIZE = 10 * 1024 * 1024

What is the expected output? What do you see instead?

Logging files with a size of up to 10 MB. Instead we observe 1 MB files.

What version of the product are you using? On what operating system?

1.0.2 with Android SDK level 19 on Android 4.3

Please provide any additional information below.

Status: New

Labels:
Type-Defect Priority-Medium