mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 19:22:22 -05:00
Add new davmail.logFileSize setting
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1223 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
e4f0a89d54
commit
13fb24d478
@ -19,12 +19,14 @@
|
||||
package davmail;
|
||||
|
||||
import davmail.ui.tray.DavGatewayTray;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.*;
|
||||
|
||||
import org.apache.log4j.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Settings facade.
|
||||
* DavMail settings are stored in the .davmail.properties file in current
|
||||
@ -236,10 +238,14 @@ public final class Settings {
|
||||
// Build file appender
|
||||
RollingFileAppender fileAppender = ((RollingFileAppender) rootLogger.getAppender("FileAppender"));
|
||||
if (fileAppender == null) {
|
||||
String logFileSize = Settings.getProperty("davmail.logFileSize");
|
||||
if (logFileSize == null || logFileSize.length() == 0) {
|
||||
logFileSize = "1MB";
|
||||
}
|
||||
fileAppender = new RollingFileAppender();
|
||||
fileAppender.setName("FileAppender");
|
||||
fileAppender.setMaxBackupIndex(2);
|
||||
fileAppender.setMaxFileSize("1MB");
|
||||
fileAppender.setMaxFileSize(logFileSize);
|
||||
fileAppender.setLayout(new PatternLayout("%d{ISO8601} %-5p [%t] %c %x - %m%n"));
|
||||
}
|
||||
fileAppender.setFile(logFilePath, true, false, 8192);
|
||||
|
Loading…
Reference in New Issue
Block a user