From 7c439595e20d73c908d52f4b2e461bae614fff5c Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 8 Oct 2009 21:59:48 +0000 Subject: [PATCH] Allow directory in logFilePath settings, add /davmail.log suffix in this case git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@773 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/Settings.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/java/davmail/Settings.java b/src/java/davmail/Settings.java index 89881f24..28a35de1 100644 --- a/src/java/davmail/Settings.java +++ b/src/java/davmail/Settings.java @@ -147,9 +147,15 @@ public final class Settings { public static String getLogFilePath() { String logFilePath = Settings.getProperty("davmail.logFilePath"); // use default log file path on Mac OS X - if ((logFilePath == null || logFilePath.length() == 0) - && System.getProperty("os.name").toLowerCase().startsWith("mac os x")) { - logFilePath = System.getProperty("user.home") + "/Library/Logs/DavMail/davmail.log"; + if ((logFilePath == null || logFilePath.length() == 0)) { + if (System.getProperty("os.name").toLowerCase().startsWith("mac os x")) { + logFilePath = System.getProperty("user.home") + "/Library/Logs/DavMail/davmail.log"; + } + } else { + File logFile = new File(logFilePath); + if (logFile.isDirectory()) { + logFilePath += "/davmail.log"; + } } return logFilePath; }