mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 10:47:59 -05:00
Set davmail.logFileSize to 0 to use an external rotation mechanism, e.g. logrotate
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2102 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
f96e874fd1
commit
225c4424eb
@ -251,16 +251,21 @@ public final class Settings {
|
||||
logFilePath = "davmail.log";
|
||||
}
|
||||
// Build file appender
|
||||
RollingFileAppender fileAppender = ((RollingFileAppender) rootLogger.getAppender("FileAppender"));
|
||||
FileAppender fileAppender = (FileAppender) rootLogger.getAppender("FileAppender");
|
||||
if (fileAppender == null) {
|
||||
String logFileSize = Settings.getProperty("davmail.logFileSize");
|
||||
if (logFileSize == null || logFileSize.length() == 0) {
|
||||
logFileSize = "1MB";
|
||||
}
|
||||
fileAppender = new RollingFileAppender();
|
||||
// set log file size to 0 to use an external rotation mechanism, e.g. logrotate
|
||||
if ("0".equals(logFileSize)) {
|
||||
fileAppender = new FileAppender();
|
||||
} else {
|
||||
fileAppender = new RollingFileAppender();
|
||||
((RollingFileAppender)fileAppender).setMaxBackupIndex(2);
|
||||
((RollingFileAppender)fileAppender).setMaxFileSize(logFileSize);
|
||||
}
|
||||
fileAppender.setName("FileAppender");
|
||||
fileAppender.setMaxBackupIndex(2);
|
||||
fileAppender.setMaxFileSize(logFileSize);
|
||||
fileAppender.setEncoding("UTF-8");
|
||||
fileAppender.setLayout(new PatternLayout("%d{ISO8601} %-5p [%t] %c %x - %m%n"));
|
||||
}
|
||||
|
@ -516,7 +516,7 @@ public class SettingsFrame extends JFrame {
|
||||
|
||||
JPanel logFilePathPanel = new JPanel(new GridLayout(2, 2));
|
||||
addSettingComponent(logFilePathPanel, BundleMessage.format("UI_LOG_FILE_PATH"), logFilePathField);
|
||||
addSettingComponent(logFilePathPanel, BundleMessage.format("UI_LOG_FILE_SIZE"), logFileSizeField);
|
||||
addSettingComponent(logFilePathPanel, BundleMessage.format("UI_LOG_FILE_SIZE"), logFileSizeField, BundleMessage.format("UI_LOG_FILE_SIZE_HELP"));
|
||||
|
||||
JButton defaultButton = new JButton(BundleMessage.format("UI_BUTTON_DEFAULT"));
|
||||
defaultButton.setToolTipText(BundleMessage.format("UI_BUTTON_DEFAULT_HELP"));
|
||||
|
@ -296,6 +296,7 @@ UI_CALDAV_EDIT_NOTIFICATIONS=Edit Caldav notifications:
|
||||
UI_CALDAV_EDIT_NOTIFICATIONS_HELP=Enable interactive Caldav edit notification window
|
||||
LOG_SEARCH_RESULT=Found {0} item(s)
|
||||
UI_LOG_FILE_SIZE=Log file size:
|
||||
UI_LOG_FILE_SIZE_HELP=Use Log4J syntax or set to 0 to use an external rotation mechanism
|
||||
UI_SAVE_IN_SENT=SMTP save in sent:
|
||||
UI_SAVE_IN_SENT_HELP=Save messages sent over SMTP in server Sent folder
|
||||
UI_CERTIFICATE_ALIAS_PROMPT=Select a certificate
|
@ -226,6 +226,7 @@ UI_CLIENT_SO_TIMEOUT_HELP=D
|
||||
UI_CLIENT_CERTIFICATE=Certificat client (DavMail vers Exchange)
|
||||
UI_LOG_FILE_PATH=Chemin du fichier de traces :
|
||||
UI_LOG_FILE_SIZE=Taille du fichier de traces :
|
||||
UI_LOG_FILE_SIZE_HELP=Syntaxe Log4J ou 0 pour utiliser un mécanisme externe de rotation
|
||||
LOG_GATEWAY_INTERRUPTED=Arrêt de la passerelle DavMail en cours
|
||||
LOG_GATEWAY_STOP=Passerelle DavMail arrêtée
|
||||
LOG_INVALID_TIMEZONE=Fuseau horaire invalide : {0}
|
||||
|
@ -263,7 +263,7 @@
|
||||
<td>Maximum log file size, use Log4J syntax, see
|
||||
<a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileAppender.html#setMaxFileSize%28java.lang.String%29">
|
||||
RollingFileAppender
|
||||
</a>
|
||||
</a>. Set to 0 to use an external rotation mechanism, e.g. logrotate.
|
||||
</td>
|
||||
<td>1MB</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user