mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-04 14:52:24 -05:00
Upgrade Log4J to 1.2.15
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@592 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
0ea975735c
commit
c271617c12
@ -92,7 +92,7 @@ Section "MainSection" SEC01
|
||||
File "dist\lib\htmlcleaner-2.1.jar"
|
||||
File "dist\lib\jackrabbit-webdav-1.4.jar"
|
||||
File "dist\lib\jdom-1.0.jar"
|
||||
File "dist\lib\log4j-1.2.8.jar"
|
||||
File "dist\lib\log4j-1.2.15.jar"
|
||||
File "dist\lib\mail-1.3.2.jar"
|
||||
File "dist\lib\slf4j-api-1.3.1.jar"
|
||||
File "dist\lib\slf4j-log4j12-1.3.1.jar"
|
||||
@ -162,7 +162,7 @@ no_quest:
|
||||
Delete "$INSTDIR\lib\htmlcleaner-2.1.jar"
|
||||
Delete "$INSTDIR\lib\jackrabbit-webdav-1.4.jar"
|
||||
Delete "$INSTDIR\lib\jdom-1.0.jar"
|
||||
Delete "$INSTDIR\lib\log4j-1.2.8.jar"
|
||||
Delete "$INSTDIR\lib\log4j-1.2.15.jar"
|
||||
Delete "$INSTDIR\lib\mail-1.3.2.jar"
|
||||
Delete "$INSTDIR\lib\slf4j-api-1.3.1.jar"
|
||||
Delete "$INSTDIR\lib\slf4j-log4j12-1.3.1.jar"
|
||||
|
@ -16,7 +16,7 @@
|
||||
<classPath>dist\lib\htmlcleaner-2.1.jar</classPath>
|
||||
<classPath>dist\lib\jackrabbit-webdav-1.4.jar</classPath>
|
||||
<classPath>dist\lib\jdom-1.0.jar</classPath>
|
||||
<classPath>dist\lib\log4j-1.2.8.jar</classPath>
|
||||
<classPath>dist\lib\log4j-1.2.15.jar</classPath>
|
||||
<classPath>dist\lib\mail-1.3.2.jar</classPath>
|
||||
<classPath>dist\lib\slf4j-api-1.3.1.jar</classPath>
|
||||
<classPath>dist\lib\slf4j-log4j12-1.3.1.jar</classPath>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<classPath>dist\lib\htmlcleaner-2.1.jar</classPath>
|
||||
<classPath>dist\lib\jackrabbit-webdav-1.4.jar</classPath>
|
||||
<classPath>dist\lib\jdom-1.0.jar</classPath>
|
||||
<classPath>dist\lib\log4j-1.2.8.jar</classPath>
|
||||
<classPath>dist\lib\log4j-1.2.15.jar</classPath>
|
||||
<classPath>dist\lib\mail-1.3.2.jar</classPath>
|
||||
<classPath>dist\lib\slf4j-api-1.3.1.jar</classPath>
|
||||
<classPath>dist\lib\slf4j-log4j12-1.3.1.jar</classPath>
|
||||
|
BIN
lib/log4j-1.2.15.jar
Normal file
BIN
lib/log4j-1.2.15.jar
Normal file
Binary file not shown.
Binary file not shown.
2
pom.xml
2
pom.xml
@ -173,7 +173,7 @@
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.8</version>
|
||||
<version>1.2.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.mail</groupId>
|
||||
|
@ -7,7 +7,6 @@ import java.io.*;
|
||||
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
|
||||
/**
|
||||
* Settings facade
|
||||
@ -73,10 +72,10 @@ public class Settings {
|
||||
SETTINGS.put("davmail.ssl.pkcs11Config", "");
|
||||
|
||||
// logging
|
||||
SETTINGS.put("log4j.rootLogger", Priority.WARN.toString());
|
||||
SETTINGS.put("log4j.logger.davmail", Priority.DEBUG.toString());
|
||||
SETTINGS.put("log4j.logger.httpclient.wire", Priority.WARN.toString());
|
||||
SETTINGS.put("log4j.logger.org.apache.commons.httpclient", Priority.WARN.toString());
|
||||
SETTINGS.put("log4j.rootLogger", Level.WARN.toString());
|
||||
SETTINGS.put("log4j.logger.davmail", Level.DEBUG.toString());
|
||||
SETTINGS.put("log4j.logger.httpclient.wire", Level.WARN.toString());
|
||||
SETTINGS.put("log4j.logger.org.apache.commons.httpclient", Level.WARN.toString());
|
||||
save();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -6,7 +6,7 @@ import davmail.DavGateway;
|
||||
import davmail.ui.AboutFrame;
|
||||
import davmail.ui.SettingsFrame;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.lf5.LF5Appender;
|
||||
import org.apache.log4j.lf5.LogLevel;
|
||||
import org.apache.log4j.lf5.viewer.LogBrokerMonitor;
|
||||
@ -75,16 +75,16 @@ public class AwtGatewayTray implements DavGatewayTrayInterface {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void displayMessage(final String message, final Priority priority) {
|
||||
public void displayMessage(final String message, final Level level) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (trayIcon != null) {
|
||||
TrayIcon.MessageType messageType = null;
|
||||
if (priority.equals(Priority.INFO)) {
|
||||
if (level.equals(Level.INFO)) {
|
||||
messageType = TrayIcon.MessageType.INFO;
|
||||
} else if (priority.equals(Priority.WARN)) {
|
||||
} else if (level.equals(Level.WARN)) {
|
||||
messageType = TrayIcon.MessageType.WARNING;
|
||||
} else if (priority.equals(Priority.ERROR)) {
|
||||
} else if (level.equals(Level.ERROR)) {
|
||||
messageType = TrayIcon.MessageType.ERROR;
|
||||
}
|
||||
if (messageType != null) {
|
||||
|
@ -4,7 +4,7 @@ import davmail.Settings;
|
||||
import davmail.BundleMessage;
|
||||
import davmail.exchange.NetworkDownException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.log4j.Level;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
@ -47,18 +47,18 @@ public class DavGatewayTray {
|
||||
return davGatewayTray == null || davGatewayTray.isActive();
|
||||
}
|
||||
|
||||
protected static void displayMessage(BundleMessage message, Priority priority) {
|
||||
LOGGER.log(priority, message.formatLog());
|
||||
protected static void displayMessage(BundleMessage message, Level level) {
|
||||
LOGGER.log(level, message.formatLog());
|
||||
if (davGatewayTray != null) {
|
||||
davGatewayTray.displayMessage(message.format(), priority);
|
||||
davGatewayTray.displayMessage(message.format(), level);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void displayMessage(BundleMessage message, Exception e, Priority priority) {
|
||||
LOGGER.log(priority, BundleMessage.getExceptionLogMessage(message, e), e);
|
||||
protected static void displayMessage(BundleMessage message, Exception e, Level level) {
|
||||
LOGGER.log(level, BundleMessage.getExceptionLogMessage(message, e), e);
|
||||
if (davGatewayTray != null
|
||||
&& (!(e instanceof NetworkDownException))) {
|
||||
davGatewayTray.displayMessage(BundleMessage.getExceptionMessage(message, e), priority);
|
||||
davGatewayTray.displayMessage(BundleMessage.getExceptionMessage(message, e), level);
|
||||
}
|
||||
if (davGatewayTray != null && e instanceof NetworkDownException) {
|
||||
davGatewayTray.inactiveIcon();
|
||||
@ -66,35 +66,35 @@ public class DavGatewayTray {
|
||||
}
|
||||
|
||||
public static void debug(BundleMessage message) {
|
||||
displayMessage(message, Priority.DEBUG);
|
||||
displayMessage(message, Level.DEBUG);
|
||||
}
|
||||
|
||||
public static void info(BundleMessage message) {
|
||||
displayMessage(message, Priority.INFO);
|
||||
displayMessage(message, Level.INFO);
|
||||
}
|
||||
|
||||
public static void warn(BundleMessage message) {
|
||||
displayMessage(message, Priority.WARN);
|
||||
displayMessage(message, Level.WARN);
|
||||
}
|
||||
|
||||
public static void error(BundleMessage message) {
|
||||
displayMessage(message, Priority.ERROR);
|
||||
displayMessage(message, Level.ERROR);
|
||||
}
|
||||
|
||||
public static void error(Exception e) {
|
||||
displayMessage(null, e, Priority.ERROR);
|
||||
displayMessage(null, e, Level.ERROR);
|
||||
}
|
||||
|
||||
public static void debug(BundleMessage message, Exception e) {
|
||||
displayMessage(message, e, Priority.DEBUG);
|
||||
displayMessage(message, e, Level.DEBUG);
|
||||
}
|
||||
|
||||
public static void warn(BundleMessage message, Exception e) {
|
||||
displayMessage(message, e, Priority.WARN);
|
||||
displayMessage(message, e, Level.WARN);
|
||||
}
|
||||
|
||||
public static void error(BundleMessage message, Exception e) {
|
||||
displayMessage(message, e, Priority.ERROR);
|
||||
displayMessage(message, e, Level.ERROR);
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package davmail.ui.tray;
|
||||
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.log4j.Level;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@ -9,10 +9,16 @@ import java.awt.*;
|
||||
*/
|
||||
public interface DavGatewayTrayInterface {
|
||||
void switchIcon();
|
||||
|
||||
void resetIcon();
|
||||
|
||||
void inactiveIcon();
|
||||
|
||||
boolean isActive();
|
||||
|
||||
Image getFrameIcon();
|
||||
void displayMessage(String message, Priority priority);
|
||||
|
||||
void displayMessage(String message, Level level);
|
||||
|
||||
void init();
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import davmail.DavGateway;
|
||||
import davmail.ui.AboutFrame;
|
||||
import davmail.ui.SettingsFrame;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.lf5.LF5Appender;
|
||||
import org.apache.log4j.lf5.LogLevel;
|
||||
import org.apache.log4j.lf5.viewer.LogBrokerMonitor;
|
||||
@ -73,17 +73,17 @@ public class FrameGatewayTray implements DavGatewayTrayInterface {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void displayMessage(final String message, final Priority priority) {
|
||||
public void displayMessage(final String message, final Level level) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
if (mainFrame != null) {
|
||||
if (priority.equals(Priority.INFO)) {
|
||||
if (level.equals(Level.INFO)) {
|
||||
errorLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
|
||||
errorArea.setText(message);
|
||||
} else if (priority.equals(Priority.WARN)) {
|
||||
} else if (level.equals(Level.WARN)) {
|
||||
errorLabel.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
|
||||
errorArea.setText(message);
|
||||
} else if (priority.equals(Priority.ERROR)) {
|
||||
} else if (level.equals(Level.ERROR)) {
|
||||
errorLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
|
||||
errorArea.setText(message);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import davmail.DavGateway;
|
||||
import davmail.ui.AboutFrame;
|
||||
import davmail.ui.SettingsFrame;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.Priority;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.lf5.LF5Appender;
|
||||
import org.apache.log4j.lf5.LogLevel;
|
||||
import org.apache.log4j.lf5.viewer.LogBrokerMonitor;
|
||||
@ -77,16 +77,16 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
|
||||
return isActive;
|
||||
}
|
||||
|
||||
public void displayMessage(final String message, final Priority priority) {
|
||||
public void displayMessage(final String message, final Level level) {
|
||||
if (trayItem != null) {
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
int messageType = 0;
|
||||
if (priority.equals(Priority.INFO)) {
|
||||
if (level.equals(Level.INFO)) {
|
||||
messageType = SWT.ICON_INFORMATION;
|
||||
} else if (priority.equals(Priority.WARN)) {
|
||||
} else if (level.equals(Level.WARN)) {
|
||||
messageType = SWT.ICON_WARNING;
|
||||
} else if (priority.equals(Priority.ERROR)) {
|
||||
} else if (level.equals(Level.ERROR)) {
|
||||
messageType = SWT.ICON_ERROR;
|
||||
}
|
||||
if (messageType != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user