diff options
author | Manuel Bentele | 2021-12-13 11:04:15 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-12-15 15:44:57 +0100 |
commit | f7daa85863f784282f6ad37db2ff39cdcdf0483d (patch) | |
tree | af6069433723345d1356f8634690de6ee6fd32c4 /dozentenmodul | |
parent | [CLIENT] Adapt OS loader of QEMU machines for local edit (diff) | |
download | tutor-module-f7daa85863f784282f6ad37db2ff39cdcdf0483d.tar.gz tutor-module-f7daa85863f784282f6ad37db2ff39cdcdf0483d.tar.xz tutor-module-f7daa85863f784282f6ad37db2ff39cdcdf0483d.zip |
[CLIENT] Update log4j because of the CVE-2021-44228 security flaw
Diffstat (limited to 'dozentenmodul')
75 files changed, 381 insertions, 290 deletions
diff --git a/dozentenmodul/README.md b/dozentenmodul/README.md index a14e2bdc..4a26712e 100644 --- a/dozentenmodul/README.md +++ b/dozentenmodul/README.md @@ -40,7 +40,7 @@ If logging configurations other than the defaults are required, the configuratio The custom configuration file is specified by executing the bwLehrpool-Suite application with the following command line call where `<CONFIG>` is an absolute path to the custom configuration file and `<APP>` is a path to the built bwLehrpool-Suite application (Java archive file): ```shell -java -Dlog4j.configuration=file:<CONFIG> -jar <APP> +java -Dlog4j.configurationFile=<CONFIG> -jar <APP> ``` diff --git a/dozentenmodul/pom.xml b/dozentenmodul/pom.xml index 9b950f16..4309e549 100755 --- a/dozentenmodul/pom.xml +++ b/dozentenmodul/pom.xml @@ -188,6 +188,18 @@ <version>2.3</version> <scope>compile</scope> </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-api</artifactId> + <version>[2.0,3.0)</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-core</artifactId> + <version>[2.0,3.0)</version> + <scope>compile</scope> + </dependency> <dependency> <groupId>com.formdev</groupId> <artifactId>flatlaf</artifactId> diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java index b64ad0b8..e246a6df 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/App.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/App.java @@ -13,22 +13,24 @@ import java.util.HashSet; import java.util.Locale; import java.util.Set; import java.util.concurrent.CountDownLatch; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.zip.Deflater; import javax.net.ssl.SSLContext; import javax.swing.SwingUtilities; import javax.swing.UIDefaults; import javax.swing.UIManager; -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.FileAppender; -import org.apache.log4j.Level; -import org.apache.log4j.LogManager; -import org.apache.log4j.Logger; -import org.apache.log4j.PatternLayout; -import org.apache.log4j.spi.LoggingEvent; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.appender.RollingFileAppender; +import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy; +import org.apache.logging.log4j.core.appender.rolling.OnStartupTriggeringPolicy; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.Configurator; +import org.apache.logging.log4j.core.config.DefaultConfiguration; +import org.apache.logging.log4j.core.layout.PatternLayout; import org.openslx.dozmod.Config.ProxyMode; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.MainWindow; @@ -47,7 +49,7 @@ import com.formdev.flatlaf.FlatLightLaf; public class App { // Logger - private final static Logger LOGGER = Logger.getLogger(App.class); + private final static Logger LOGGER = LogManager.getLogger(App.class); public static final int THRIFT_PORT = 9090; @@ -64,79 +66,49 @@ public class App { private static String setupFileLogger() { // path to the log file - final String logFilePath = Config.getPath() + File.separator + Branding.getConfigDirectory() + ".log"; - - // check if we had an old log file - final File logFile = new File(logFilePath); - if (logFile.exists() && !logFile.isDirectory()) { - // we have one, rename it to 'bwSuite.log.old' - try { - File oldFile = new File(logFilePath + ".old"); - oldFile.delete(); - logFile.renameTo(oldFile); - logFile.delete(); - } catch (Exception e) { - LOGGER.error("Could not move '" + logFilePath + "' to '" + logFilePath + ".old'", e); - } - } - - // add file appender to global logger - FileAppender fa = null; - try { - fa = new FileAppender(new PatternLayout("[%t] %-5p %F - %m%n"), logFilePath); - fa.setEncoding("UTF-8"); - fa.setThreshold(Level.DEBUG); - } catch (IOException e) { - LOGGER.error("Failed to set logfile path to '" + logFilePath + "': ", e); - return null; - } - - final FileAppender ffa = fa; - final Pattern re = Pattern.compile("authorization:(\\w|\\+|/|\\s)+", Pattern.CASE_INSENSITIVE - | Pattern.MULTILINE); - - AppenderSkeleton ap = new AppenderSkeleton() { - - @Override - public boolean requiresLayout() { - return ffa.requiresLayout(); - } - - @Override - public void close() { - ffa.close(); - } - - @Override - protected void append(LoggingEvent event) { - // TODO Set up filtering properly - if ("org.apache.http.wire".equals(event.getLoggerName())) - return; - String s = event.getRenderedMessage(); - if (s.contains("uthorization")) { - Matcher m = re.matcher(s); - if (m.find()) { - s = m.replaceAll("Authorization: ***********"); - } - } - ffa.append(new LoggingEvent(event.getFQNOfLoggerClass(), event.getLogger(), - event.getTimeStamp(), event.getLevel(), s, event.getThreadName(), - event.getThrowableInformation(), event.getNDC(), event.getLocationInformation(), - event.getProperties())); - } - }; + final String logFileName = Config.getPath() + File.separator + Branding.getConfigDirectory() + ".log"; + final LoggerContext loggingContext = LoggerContext.class.cast(LogManager.getContext(false)); + final Configuration loggingConfig = loggingContext.getConfiguration(); + + // add rolling file appender + final RollingFileAppender fileAppender = RollingFileAppender.newBuilder() + .setName("logToFile") + .withFileName(logFileName) + .withFilePattern(logFileName + ".%i") + .withAppend(true) + .withBufferedIo(true) + .setConfiguration(loggingConfig) + .withCreateOnDemand(false) + .setLayout(PatternLayout.newBuilder() + .withConfiguration(loggingConfig) + .withPattern("[%t] %-5p %F - %m%n") + .build()) + .withStrategy(DefaultRolloverStrategy.newBuilder() + .withMin("1") + .withMax("9") + .withFileIndex("1") + .withCompressionLevelStr(Integer.toString(Deflater.NO_COMPRESSION)) + .withConfig(loggingConfig) + .build()) + .withPolicy(OnStartupTriggeringPolicy.createPolicy(1)) + .build(); + + fileAppender.start(); + + // register rolling file appender + loggingConfig.addAppender(fileAppender); + loggingConfig.getRootLogger().addAppender(fileAppender, Level.ALL, null); - // register file logger (appender) - BasicConfigurator.configure(ap); + loggingContext.updateLoggers(loggingConfig); - return logFilePath; + return logFileName; } public static void main(final String[] args) throws InvocationTargetException, InterruptedException { - // setup basic logging appender to log output on console if no external appender (log4j.properties) is configured - if (LogManager.getRootLogger().getAllAppenders() == null) { - BasicConfigurator.configure(); + // setup basic logging appender to log output on console if no external appender (log4j2.properties) is configured + if (org.apache.logging.log4j.core.Logger.class.cast(LogManager.getRootLogger()).getAppenders().isEmpty()) { + Configurator.initialize(new DefaultConfiguration()); } if (args.length >= 2) { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/Branding.java b/dozentenmodul/src/main/java/org/openslx/dozmod/Branding.java index 65086b85..8ff3a584 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/Branding.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/Branding.java @@ -22,12 +22,12 @@ import java.util.List; import java.util.Properties; import org.openslx.dozmod.Config.ProxyMode; - -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public final class Branding { - private final static Logger LOGGER = Logger.getLogger(Branding.class); + private final static Logger LOGGER = LogManager.getLogger(Branding.class); private final static String PROPERTIES_FILE = "branding.properties"; private final static Properties PROPERTIES = new Properties(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java index d3a561c9..6ca1d195 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/Config.java @@ -8,7 +8,8 @@ import java.io.IOException; import java.io.InputStream; import java.util.Properties; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.util.OsHelper; import org.openslx.util.QuickTimer; import org.openslx.util.QuickTimer.Task; @@ -25,7 +26,7 @@ public class Config { /** * Logger for this class */ - private final static Logger LOGGER = Logger.getLogger(Config.class); + private final static Logger LOGGER = LogManager.getLogger(Config.class); public static final int TRANSFER_TIMEOUT = 20 * 1000; // 20s timeout for hung transfers diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java index 5e4238cb..52092d4f 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/EcpAuthenticator.java @@ -11,7 +11,8 @@ import java.util.Map.Entry; import org.apache.commons.codec.binary.Base64; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.Satellite; import org.openslx.bwlp.thrift.iface.TAuthorizationException; import org.openslx.dozmod.authentication.ServiceProviderResponse.JSatellite; @@ -28,7 +29,7 @@ public class EcpAuthenticator implements Authenticator { /** * Logger instance for this class */ - private final static Logger LOGGER = Logger.getLogger(EcpAuthenticator.class); + private final static Logger LOGGER = LogManager.getLogger(EcpAuthenticator.class); private final String ecpUrl; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/FingerprintManager.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/FingerprintManager.java index cc0d09f7..5980b664 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/FingerprintManager.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/FingerprintManager.java @@ -7,12 +7,13 @@ import java.io.IOException; import java.util.Properties; import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; public class FingerprintManager { - private static final Logger LOGGER = Logger.getLogger(FingerprintManager.class); + private static final Logger LOGGER = LogManager.getLogger(FingerprintManager.class); private static final File file = new File(Config.getPath(), "fingerprints.properties"); private static final Properties prop = new Properties(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java index 1c6062b6..2f40f782 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/ShibbolethEcp.java @@ -10,7 +10,8 @@ import org.apache.http.HttpResponse; import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache.http.util.EntityUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.AuthorizationError; import org.openslx.bwlp.thrift.iface.TAuthorizationException; import org.openslx.dozmod.Branding; @@ -28,7 +29,7 @@ public class ShibbolethEcp { /** * Logger instance for this class */ - private final static Logger LOGGER = Logger.getLogger(ShibbolethEcp.class); + private final static Logger LOGGER = LogManager.getLogger(ShibbolethEcp.class); /** * Static gson object for (de)serialization diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java index 5adeb394..bc08dc39 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/authentication/TestAccountAuthenticator.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.authentication; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ClientSessionData; import org.openslx.bwlp.thrift.iface.TAuthorizationException; @@ -16,7 +17,7 @@ public class TestAccountAuthenticator implements Authenticator { /** * Logger instance for this class */ - private final static Logger LOGGER = Logger.getLogger(TestAccountAuthenticator.class); + private final static Logger LOGGER = LogManager.getLogger(TestAccountAuthenticator.class); @Override public void login(String username, String password, AuthenticatorCallback callback) diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java index fee04b42..e427d064 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/AsyncHashGenerator.java @@ -14,7 +14,8 @@ import java.util.concurrent.RejectedExecutionException; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.TInvalidTokenException; import org.openslx.dozmod.thrift.Session; @@ -28,7 +29,7 @@ import org.openslx.util.Util; public class AsyncHashGenerator extends Thread { - private static final Logger LOGGER = Logger.getLogger(AsyncHashGenerator.class); + private static final Logger LOGGER = LogManager.getLogger(AsyncHashGenerator.class); private static final ThreadPoolExecutor pool = new GrowingThreadPoolExecutor(1, Runtime.getRuntime() .availableProcessors(), 10, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(4), diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/DownloadTask.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/DownloadTask.java index 1407204d..0692f8a2 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/DownloadTask.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/DownloadTask.java @@ -5,7 +5,8 @@ import java.io.FileNotFoundException; import java.io.RandomAccessFile; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.TransferState; import org.openslx.dozmod.Config; import org.openslx.filetransfer.DataReceivedCallback; @@ -26,7 +27,7 @@ public class DownloadTask extends TransferTask { /** * Logger instance for this class. */ - private final static Logger LOGGER = Logger.getLogger(DownloadTask.class); + private final static Logger LOGGER = LogManager.getLogger(DownloadTask.class); private final String host; private final int port; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java index d61075eb..305ff50d 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java @@ -6,7 +6,8 @@ import java.util.Iterator; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.TransferState; import org.openslx.dozmod.thrift.Session; import org.openslx.filetransfer.Transfer; @@ -14,7 +15,7 @@ import org.openslx.util.Util; public abstract class TransferTask implements Runnable, TransferEventEmitter { - private static final Logger LOGGER = Logger.getLogger(TransferTask.class); + private static final Logger LOGGER = LogManager.getLogger(TransferTask.class); protected static final double BYTES_PER_MIB = 1024 * 1024; protected static final long CHUNK_SIZE = 16 * 1024 * 1024; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/UploadTask.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/UploadTask.java index 7396d1d2..f10e94ea 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/UploadTask.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/UploadTask.java @@ -4,7 +4,8 @@ import java.io.File; import java.io.FileNotFoundException; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.TInvalidTokenException; import org.openslx.bwlp.thrift.iface.TransferState; @@ -24,7 +25,7 @@ public class UploadTask extends TransferTask { /** * Logger instance for this class. */ - private final static Logger LOGGER = Logger.getLogger(UploadTask.class); + private final static Logger LOGGER = LogManager.getLogger(UploadTask.class); /** * Update interval of the block progress (needs thrift call to sat) */ diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/GraphicalCertHandler.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/GraphicalCertHandler.java index c1432614..48b6a14a 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/GraphicalCertHandler.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/GraphicalCertHandler.java @@ -12,7 +12,8 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.LogManager; import org.openslx.dozmod.authentication.FingerprintManager; import org.openslx.dozmod.gui.Gui.GuiCallable; import org.openslx.dozmod.gui.helper.I18n; @@ -20,7 +21,7 @@ import org.openslx.dozmod.gui.helper.MessageType; public class GraphicalCertHandler { - private static final Logger LOGGER = Logger.getLogger(GraphicalCertHandler.GuiTrustManager.class); + private static final Logger LOGGER = LogManager.getLogger(GraphicalCertHandler.GuiTrustManager.class); private class GuiTrustManager implements X509TrustManager { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/Gui.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/Gui.java index b61f961d..1d1dd90e 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/Gui.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/Gui.java @@ -29,7 +29,8 @@ import javax.swing.event.HyperlinkEvent; import javax.swing.event.HyperlinkListener; import javax.swing.text.html.HTMLDocument; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.util.DesktopEnvironment; @@ -38,7 +39,7 @@ import org.openslx.util.QuickTimer; public class Gui { - private static final Logger LOGGER = Logger.getLogger(Gui.class); + private static final Logger LOGGER = LogManager.getLogger(Gui.class); private static long lastUserActivity = System.currentTimeMillis(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/MainWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/MainWindow.java index 24b0cb01..d8e7f797 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/MainWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/MainWindow.java @@ -30,7 +30,8 @@ import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SwingUtilities; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.SatelliteStatus; import org.openslx.bwlp.thrift.iface.TransferState; @@ -72,7 +73,7 @@ import org.openslx.util.QuickTimer.Task; public abstract class MainWindow { - private final static Logger LOGGER = Logger.getLogger(MainWindow.class); + private final static Logger LOGGER = LogManager.getLogger(MainWindow.class); private static final JFrame mainWindow; private static final JPanel mainContainer; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java index b0d9b1c3..000e004e 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java @@ -6,7 +6,8 @@ import java.awt.event.ActionListener; import javax.swing.Box; import javax.swing.JCheckBox; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.SscMode; import org.openslx.bwlp.thrift.iface.TAuthorizationException; @@ -31,7 +32,7 @@ public class UploadPanel extends TransferPanel implements QuitNotification { */ private static final long serialVersionUID = -8905745015422520339L; - private static final Logger LOGGER = Logger.getLogger(UploadPanel.class); + private static final Logger LOGGER = LogManager.getLogger(UploadPanel.class); private final UploadInitiator state; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/changemonitor/DialogChangeMonitor.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/changemonitor/DialogChangeMonitor.java index 6e2df962..a9c8ee37 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/changemonitor/DialogChangeMonitor.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/changemonitor/DialogChangeMonitor.java @@ -12,7 +12,8 @@ import javax.swing.JTable; import javax.swing.text.JTextComponent; import javax.swing.tree.TreePath; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.jdatepicker.JDatePicker; import org.openslx.dozmod.gui.control.ComboBox; import org.openslx.dozmod.gui.control.JCheckBoxTree; @@ -20,7 +21,7 @@ import org.openslx.util.Util; public class DialogChangeMonitor { - private static final Logger LOGGER = Logger.getLogger(DialogChangeMonitor.class); + private static final Logger LOGGER = LogManager.getLogger(DialogChangeMonitor.class); private final Callback callback; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ContainerBindMountConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ContainerBindMountConfigurator.java index a58df382..adfc8f22 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ContainerBindMountConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ContainerBindMountConfigurator.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.configurator; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.changemonitor.GenericControlWindow; import org.openslx.dozmod.gui.control.QLabel; @@ -26,7 +27,7 @@ public class ContainerBindMountConfigurator extends JPanel */ private static final long serialVersionUID = -3439578767452418382L; - private final Logger LOGGER = Logger.getLogger(ContainerBindMountConfigurator.class); + private final Logger LOGGER = LogManager.getLogger(ContainerBindMountConfigurator.class); private final ContainerBindMountTable bindMountTable; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java index dd47b19d..40a59ca1 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/ImagePermissionConfigurator.java @@ -25,7 +25,8 @@ import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ChangeListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImagePermissions; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.dozmod.gui.changemonitor.GenericControlWindow; @@ -61,7 +62,7 @@ public class ImagePermissionConfigurator extends JPanel implements GenericContro private ImagePermissions defaultPermissions; - private static final Logger LOGGER = Logger.getLogger(ImagePermissionConfigurator.class); + private static final Logger LOGGER = LogManager.getLogger(ImagePermissionConfigurator.class); public ImagePermissionConfigurator() { super(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java index 817289be..bd3905da 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LdapFilterConfigurator.java @@ -19,7 +19,8 @@ import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.LdapFilter; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.changemonitor.DialogChangeMonitor; @@ -39,7 +40,7 @@ import org.openslx.dozmod.thrift.cache.MetaDataCache; public class LdapFilterConfigurator extends LdapFilterConfiguratorLayout { private static final long serialVersionUID = -3336605759245603655L; - private final static Logger LOGGER = Logger.getLogger(LdapFilterConfigurator.class); + private final static Logger LOGGER = LogManager.getLogger(LdapFilterConfigurator.class); public LdapFilterConfigurator() { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java index 27a7e9f7..dc5ea326 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/LecturePermissionConfigurator.java @@ -23,7 +23,8 @@ import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.event.ChangeListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.LecturePermissions; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.dozmod.gui.changemonitor.GenericControlWindow; @@ -66,7 +67,7 @@ public class LecturePermissionConfigurator extends JPanel implements GenericCont private String ownerId = null; - private static final Logger LOGGER = Logger.getLogger(LecturePermissionConfigurator.class); + private static final Logger LOGGER = LogManager.getLogger(LecturePermissionConfigurator.class); public LecturePermissionConfigurator() { super(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java index c24a3edb..c2d67ea9 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetrulesConfigurator.java @@ -41,7 +41,8 @@ import javax.swing.text.StyleConstants; import javax.swing.text.TabSet; import javax.swing.text.TabStop; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.LectureRead; import org.openslx.bwlp.thrift.iface.NetDirection; import org.openslx.bwlp.thrift.iface.NetRule; @@ -93,7 +94,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout implements } private static final long serialVersionUID = -3497629601818983994L; - private final static Logger LOGGER = Logger.getLogger(NetrulesConfigurator.class); + private final static Logger LOGGER = LogManager.getLogger(NetrulesConfigurator.class); private boolean checkChange = false; private StateWrapper currentState = new StateWrapper(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java index 284f637d..7e318aa1 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/configurator/NetshareConfigurator.java @@ -26,7 +26,8 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TableModelListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.NetShare; import org.openslx.bwlp.thrift.iface.NetShareAuth; import org.openslx.dozmod.gui.Gui; @@ -49,7 +50,7 @@ import org.openslx.dozmod.util.FormatHelper; public class NetshareConfigurator extends NetshareConfiguratorLayout { private static final long serialVersionUID = -3336605759245603655L; - private final static Logger LOGGER = Logger.getLogger(NetshareConfigurator.class); + private final static Logger LOGGER = LogManager.getLogger(NetshareConfigurator.class); public static final Character EMPTY_MARKER = '-'; public static final String PRINTER_MARKER = "PRINTER"; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/LocationSelector.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/LocationSelector.java index e62bbde8..101dbde9 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/LocationSelector.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/LocationSelector.java @@ -19,7 +19,8 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.Location; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.changemonitor.AbstractControlWrapper; @@ -49,7 +50,7 @@ public class LocationSelector extends JPanel { */ private static final long serialVersionUID = 3847194308363804953L; - private final static Logger LOGGER = Logger.getLogger(LocationSelector.class); + private final static Logger LOGGER = LogManager.getLogger(LocationSelector.class); private final JRadioButton btnLimitToLocations; private final JRadioButton btnPrioritizeInLocations; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/QDatePickerImpl.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/QDatePickerImpl.java index d698f076..451a843c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/QDatePickerImpl.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/QDatePickerImpl.java @@ -11,7 +11,8 @@ import java.util.Set; import javax.swing.JButton; import javax.swing.JTextField; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.jdatepicker.ComponentColorDefaults; import org.jdatepicker.ComponentColorDefaults.Key; import org.jdatepicker.JDatePicker; @@ -25,7 +26,7 @@ public class QDatePickerImpl extends JDatePicker { */ private static final long serialVersionUID = -5858434848990729141L; - private static final Logger LOGGER = Logger.getLogger(QDatePickerImpl.class); + private static final Logger LOGGER = LogManager.getLogger(QDatePickerImpl.class); private final JButton pickButton; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/DebugWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/DebugWindow.java index f740b83d..be8c992c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/DebugWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/DebugWindow.java @@ -3,6 +3,7 @@ package org.openslx.dozmod.gui.helper; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Insets; +import java.io.Serializable; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -15,15 +16,85 @@ import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; -import org.apache.log4j.Appender; -import org.apache.log4j.AppenderSkeleton; -import org.apache.log4j.BasicConfigurator; -import org.apache.log4j.Level; -import org.apache.log4j.spi.LoggingEvent; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.Core; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.Layout; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.Property; +import org.apache.logging.log4j.core.config.plugins.Plugin; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.openslx.dozmod.gui.Gui; +@Plugin(name = "DebugAppender", category = Core.CATEGORY_NAME, elementType = Appender.ELEMENT_TYPE) +class DebugAppender extends AbstractAppender +{ + private static final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss"); + private final JTextPane textPane; + + protected DebugAppender(final String name, final Filter filter, final Layout<? extends Serializable> layout, + final boolean ignoreExceptions, final Property[] properties, final JTextPane textPane) + { + super(name, filter, layout, ignoreExceptions, properties); + this.textPane = textPane; + } + + protected DebugAppender(final String name, final Filter filter, final JTextPane textPane) + { + this(name, filter, null, true, null, textPane); + } + + @Override + public void append(LogEvent event) + { + final Level eventLevel = event.getLevel(); + final Color eventColor; + + if (eventLevel.isMoreSpecificThan(Level.ERROR)) { + eventColor = Color.RED; + } else if (eventLevel.isMoreSpecificThan(Level.WARN)) { + eventColor = Color.ORANGE; + } else if (eventLevel.isMoreSpecificThan(Level.INFO)) { + eventColor = Color.BLACK; + } else { + eventColor = Color.GRAY; + } + + final long eventTimestamp = event.getTimeMillis(); + final String eventThreadName = event.getThreadName(); + final String eventLoggerName = event.getLoggerName(); + final String eventMessage = event.getMessage().getFormattedMessage(); + + Gui.asyncExec( new Runnable() { + @Override + public void run() + { + printEvent("[" + formatter.print( eventTimestamp ) + "] ", Color.BLACK); + printEvent(eventThreadName + "@" + eventLoggerName.replaceAll("^.*\\.", ""), Color.GRAY); + printEvent(" " + eventMessage + "\n", eventColor); + } + } ); + } + + private void printEvent(String msg, Color c) { + StyledDocument doc = this.textPane.getStyledDocument(); + SimpleAttributeSet keyWord = new SimpleAttributeSet(); + StyleConstants.setForeground(keyWord, c); + try { + doc.insertString(doc.getLength(), msg, keyWord); + } catch (BadLocationException e) { + e.printStackTrace(); // Do not use LOGGER here to prevent infinite loop + } + this.textPane.setCaretPosition(doc.getLength()); + } +} + public class DebugWindow extends JPanel { /** @@ -31,8 +102,6 @@ public class DebugWindow extends JPanel { */ private static final long serialVersionUID = 2602474207529142616L; - private static final DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss"); - private final JTextPane txtLog; public DebugWindow() { @@ -51,56 +120,17 @@ public class DebugWindow extends JPanel { } private void registerLogger() { - Appender appender = new AppenderSkeleton() { + final LoggerContext loggingContext = LoggerContext.class.cast(LogManager.getContext(false)); + final Configuration loggingConfig = loggingContext.getConfiguration(); + + // add debug logging appender + final DebugAppender debugAppender = new DebugAppender("logToDebug", null, this.txtLog); + debugAppender.start(); + + // register debug logging appender + loggingConfig.addAppender(debugAppender); + loggingConfig.getRootLogger().addAppender(debugAppender, Level.ALL, null); - @Override - public boolean requiresLayout() { - return false; - } - - @Override - public void close() { - // Nothing to do - } - - @Override - protected void append(final LoggingEvent event) { - final Level l = event.getLevel(); - final Color c; - if (l.isGreaterOrEqual(Level.ERROR)) { - c = Color.RED; - } else if (l.isGreaterOrEqual(Level.WARN)) { - c = Color.ORANGE; - } else if (l.isGreaterOrEqual(Level.INFO)) { - c = Color.BLACK; - } else { - c = Color.GRAY; - } - Gui.asyncExec(new Runnable() { - @Override - public void run() { - - log("[" + formatter.print(event.getTimeStamp()) + "] ", Color.BLACK); - log(event.getThreadName() + "@" + event.getLoggerName().replaceAll("^.*\\.", ""), - Color.GRAY); - log(" " + event.getMessage() + "\n", c); - } - }); - } - }; - BasicConfigurator.configure(appender); + loggingContext.updateLoggers(loggingConfig); } - - private void log(String msg, Color c) { - StyledDocument doc = txtLog.getStyledDocument(); - SimpleAttributeSet keyWord = new SimpleAttributeSet(); - StyleConstants.setForeground(keyWord, c); - try { - doc.insertString(doc.getLength(), msg, keyWord); - } catch (BadLocationException e) { - e.printStackTrace(); // Do not use LOGGER here to prevent infinite loop - } - txtLog.setCaretPosition(doc.getLength()); - } - } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/ExpiryDateChooser.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/ExpiryDateChooser.java index f97298f3..f2dd9535 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/ExpiryDateChooser.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/ExpiryDateChooser.java @@ -11,14 +11,15 @@ import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.control.QLabel; import org.openslx.dozmod.thrift.Session; import org.openslx.dozmod.util.FormatHelper; public class ExpiryDateChooser { - private static final Logger LOGGER = Logger.getLogger(ExpiryDateChooser.class); + private static final Logger LOGGER = LogManager.getLogger(ExpiryDateChooser.class); /** * Helper to ask the user for the number of days to extend a date with. If diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/I18n.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/I18n.java index 61fdb049..ccd28c85 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/I18n.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/I18n.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.helper; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.text.MessageFormat; import java.util.ResourceBundle; @@ -26,7 +27,7 @@ public enum I18n { /** * Logger for this class */ - private final static Logger LOGGER = Logger.getLogger(I18n.class); + private final static Logger LOGGER = LogManager.getLogger(I18n.class); private final ResourceBundle resourceBundle; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/MessageType.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/MessageType.java index 0e0d2dc8..58037430 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/MessageType.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/MessageType.java @@ -2,7 +2,7 @@ package org.openslx.dozmod.gui.helper; import javax.swing.JOptionPane; -import org.apache.log4j.Level; +import org.apache.logging.log4j.Level; public enum MessageType { DEBUG(JOptionPane.INFORMATION_MESSAGE, -1, I18n.HELPER.getString("MessageType.debug"), Level.DEBUG), diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/QFileChooser.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/QFileChooser.java index ddac98f0..7dadd3ca 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/QFileChooser.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/helper/QFileChooser.java @@ -7,7 +7,8 @@ import javax.swing.JFileChooser; import javax.swing.LookAndFeel; import javax.swing.UIManager; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class QFileChooser extends JFileChooser { @@ -16,7 +17,7 @@ public class QFileChooser extends JFileChooser { */ private static final long serialVersionUID = 3856532034624815076L; - private static final Logger LOGGER = Logger.getLogger(QFileChooser.class); + private static final Logger LOGGER = LogManager.getLogger(QFileChooser.class); public QFileChooser(String path, boolean dirMode) { super(path); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java index 63d4a075..0bea8587 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/panel/ContainerPanel.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.panel; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.dozmod.gui.Gui; @@ -31,7 +32,7 @@ public class ContainerPanel extends JPanel { public static final String IMAGE_CONTEXT = "IMAGE"; public static final String CONTAINER_CONTEXT = "CONTAINER"; - private final Logger LOGGER = Logger.getLogger(ContainerPanel.class); + private final Logger LOGGER = LogManager.getLogger(ContainerPanel.class); private final QLabel lblContainerImageType; private final ComboBox<ContainerMeta.ContainerImageType> cboContainerImageType; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ConfigWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ConfigWindow.java index 6e94735d..c64fbfca 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ConfigWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ConfigWindow.java @@ -11,7 +11,8 @@ import javax.swing.UIManager; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.SatelliteUserConfig; import org.openslx.dozmod.Config; @@ -34,7 +35,7 @@ public class ConfigWindow extends ConfigWindowLayout implements UiFeedback, Acti */ private static final long serialVersionUID = 1528773221604107054L; - private final static Logger LOGGER = Logger.getLogger(ConfigWindow.class); + private final static Logger LOGGER = LogManager.getLogger(ConfigWindow.class); private SatelliteUserConfig userConfig = null; private JRadioButton selectedLookAndFeel = null; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java index 5307a871..97128e75 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/DisclaimerWindow.java @@ -11,7 +11,8 @@ import java.security.NoSuchAlgorithmException; import org.apache.commons.codec.binary.Hex; import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.helper.UiFeedback; import org.openslx.dozmod.util.ResourceLoader; @@ -26,7 +27,7 @@ public class DisclaimerWindow extends GenericNoticeWindow implements UiFeedback */ private static final long serialVersionUID = 8479978304760663L; - private final static Logger LOGGER = Logger.getLogger(PrivacyNoticeWindow.class); + private final static Logger LOGGER = LogManager.getLogger(PrivacyNoticeWindow.class); final DisclaimerWindow me = this; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/GenericNoticeWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/GenericNoticeWindow.java index 42f9758d..7b39998f 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/GenericNoticeWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/GenericNoticeWindow.java @@ -11,7 +11,8 @@ import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JScrollBar; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; @@ -30,7 +31,7 @@ public abstract class GenericNoticeWindow extends GenericNoticeWindowLayout impl final GenericNoticeWindow me = this; - private final static Logger LOGGER = Logger.getLogger(GenericNoticeWindow.class); + private final static Logger LOGGER = LogManager.getLogger(GenericNoticeWindow.class); private boolean shouldBeShown = true; public GenericNoticeWindow(Frame modalParent, boolean shouldBeShown) { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java index 8d31798f..0d63dcb4 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java @@ -24,7 +24,8 @@ import javax.swing.KeyStroke; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.*; import org.openslx.dozmod.Branding; @@ -71,7 +72,7 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout */ private static final long serialVersionUID = -1901954219828374015L; - private static final Logger LOGGER = Logger.getLogger(ImageDetailsWindow.class); + private static final Logger LOGGER = LogManager.getLogger(ImageDetailsWindow.class); /** * Self-reference diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java index bc30c3c5..9434ad25 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java @@ -19,7 +19,8 @@ import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.MainWindow; @@ -53,7 +54,7 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa */ private static final long serialVersionUID = 84238230133246131L; - private final static Logger LOGGER = Logger.getLogger(ImageListWindow.class); + private final static Logger LOGGER = LogManager.getLogger(ImageListWindow.class); /** * Self-reference diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java index a04d09c9..4c2d4f7c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java @@ -22,7 +22,8 @@ import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.Organization; @@ -57,7 +58,7 @@ public class ImagePublishedWindow extends ImagePublishedWindowLayout implements */ private static final long serialVersionUID = 7455819819182519090L; - private final static Logger LOGGER = Logger.getLogger(ImagePublishedWindow.class); + private final static Logger LOGGER = LogManager.getLogger(ImagePublishedWindow.class); private final ImagePublishedWindow me = this; // Filtering: matches against image's name, user's first/last name or email and organisation name of the owner diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java index 2980b03c..52c333d2 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureChangeImage.java @@ -13,7 +13,8 @@ import javax.swing.event.ChangeListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.changemonitor.DialogChangeMonitor; @@ -35,7 +36,7 @@ public class LectureChangeImage extends LectureChangeImageLayout implements UiFe */ private static final long serialVersionUID = 3558697767037191501L; - private static final Logger LOGGER = Logger.getLogger(LectureChangeImage.class); + private static final Logger LOGGER = LogManager.getLogger(LectureChangeImage.class); private boolean okUsed = false; private ImageTable imageTable; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java index 11c0d605..1bf231f2 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.window; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.*; import org.openslx.dozmod.gui.Gui; @@ -51,7 +52,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements */ private static final long serialVersionUID = -2190481933307215137L; - private static final Logger LOGGER = Logger.getLogger(LectureDetailsWindow.class); + private static final Logger LOGGER = LogManager.getLogger(LectureDetailsWindow.class); /** * Self-reference diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java index e45fcac8..499d1e37 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java @@ -26,7 +26,8 @@ import javax.swing.UIManager; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.bwlp.thrift.iface.ImageVersionDetails; @@ -64,7 +65,7 @@ public class LectureListWindow extends LectureListWindowLayout { */ private static final long serialVersionUID = 3135935034893934652L; - private final static Logger LOGGER = Logger.getLogger(LectureListWindow.class); + private final static Logger LOGGER = LogManager.getLogger(LectureListWindow.class); public final LectureListWindow me = this; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java index ba91b0f0..eab1c4f9 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java @@ -19,7 +19,8 @@ import javax.swing.JFrame; import javax.swing.KeyStroke; import javax.swing.SwingUtilities; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TBaseHelper; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.Organization; @@ -63,7 +64,7 @@ public class LoginWindow extends LoginWindowLayout { */ private static final long serialVersionUID = 3826201134186162076L; - private final static Logger LOGGER = Logger.getLogger(LoginWindow.class); + private final static Logger LOGGER = LogManager.getLogger(LoginWindow.class); public static enum LoginType { ECP(0), diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/PrivacyNoticeWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/PrivacyNoticeWindow.java index 03a4c790..0ed4ee53 100755 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/PrivacyNoticeWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/PrivacyNoticeWindow.java @@ -11,7 +11,8 @@ import java.security.NoSuchAlgorithmException; import org.apache.commons.codec.binary.Hex; import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.helper.UiFeedback; import org.openslx.dozmod.util.ResourceLoader; @@ -26,7 +27,7 @@ public class PrivacyNoticeWindow extends GenericNoticeWindow implements UiFeedba */ private static final long serialVersionUID = -7356663101779860276L; - private final static Logger LOGGER = Logger.getLogger(PrivacyNoticeWindow.class); + private final static Logger LOGGER = LogManager.getLogger(PrivacyNoticeWindow.class); final PrivacyNoticeWindow me = this; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java index 3fccf3dd..1818323d 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtConfigEditorWindow.java @@ -13,7 +13,8 @@ import java.util.Arrays; import java.util.List; import java.util.TreeSet; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; @@ -36,7 +37,7 @@ public class VirtConfigEditorWindow extends VirtConfigEditorWindowLayout impleme */ private static final long serialVersionUID = 8416526255408870346L; - private final static Logger LOGGER = Logger.getLogger(VirtConfigEditorWindow.class); + private final static Logger LOGGER = LogManager.getLogger(VirtConfigEditorWindow.class); public interface VirtConfigChanged { public void virtConfigChanged(String newVmx); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java index 46bc032c..44544ed1 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/VirtDropDownConfigEditorWindow.java @@ -23,7 +23,8 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.control.ComboBox; import org.openslx.dozmod.gui.control.ComboBox.ComboBoxRenderer; @@ -58,7 +59,7 @@ public class VirtDropDownConfigEditorWindow extends JDialog */ private static final long serialVersionUID = 230794205942072411L; - private final static Logger LOGGER = Logger.getLogger(VirtDropDownConfigEditorWindow.class); + private final static Logger LOGGER = LogManager.getLogger(VirtDropDownConfigEditorWindow.class); public interface VirtConfigChanged { public void virtConfigChanged(String newVmx); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LoginWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LoginWindowLayout.java index d68ebba4..55b525d9 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LoginWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LoginWindowLayout.java @@ -18,7 +18,8 @@ import javax.swing.JSeparator; import javax.swing.JTextField; import javax.swing.border.TitledBorder; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.Organization; import org.openslx.dozmod.Branding; import org.openslx.dozmod.gui.Gui; @@ -36,7 +37,7 @@ public abstract class LoginWindowLayout extends JDialog { */ private static final long serialVersionUID = 4666636501698824636L; - private static final Logger LOGGER = Logger.getLogger(LoginWindowLayout.class); + private static final Logger LOGGER = LogManager.getLogger(LoginWindowLayout.class); // TODO This has nothing to to with the layout protected static enum LOGIN_TYPE { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java index 885e40f7..11d3846a 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageCreationWizard.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.wizard; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageBaseWrite; import org.openslx.bwlp.thrift.iface.ImageVersionWrite; @@ -34,7 +35,7 @@ public class ImageCreationWizard extends Wizard implements UiFeedback, QuitNotif */ private static final long serialVersionUID = -353405234601306343L; - private final static Logger LOGGER = Logger.getLogger(ImageCreationWizard.class); + private final static Logger LOGGER = LogManager.getLogger(ImageCreationWizard.class); private final UploadWizardState state = new UploadWizardState(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java index d05b02b5..a82801ac 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/ImageUpdateWizard.java @@ -2,7 +2,8 @@ package org.openslx.dozmod.gui.wizard; import java.awt.Window; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.bwlp.thrift.iface.ImageVersionWrite; @@ -29,7 +30,7 @@ public class ImageUpdateWizard extends Wizard implements UiFeedback, QuitNotific */ private static final long serialVersionUID = -584900619809829672L; - private final static Logger LOGGER = Logger.getLogger(ImageCreationWizard.class); + private final static Logger LOGGER = LogManager.getLogger(ImageCreationWizard.class); private final UploadWizardState state = new UploadWizardState(); protected ImageUploadPage imageUploadPage; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java index 59c79a88..bd7c0aeb 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/LectureWizard.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.gui.wizard; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.LectureWrite; import org.openslx.dozmod.gui.Gui; @@ -26,7 +27,7 @@ public class LectureWizard extends Wizard implements UiFeedback { */ private static final long serialVersionUID = -7447355922540362345L; - private final static Logger LOGGER = Logger.getLogger(LectureWizard.class); + private final static Logger LOGGER = LogManager.getLogger(LectureWizard.class); public final LectureWizardState state = new LectureWizardState(); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java index 940531c6..389e4005 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ContainerUploadPage.java @@ -1,7 +1,8 @@ package org.openslx.dozmod.gui.wizard.page; import org.apache.commons.io.FileUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.Gui; @@ -40,7 +41,7 @@ public class ContainerUploadPage extends ContainerUploadPageLayout { */ private static final long serialVersionUID = 2564301984375080698L; - private final Logger LOGGER = Logger.getLogger(ContainerUploadPage.class); + private final Logger LOGGER = LogManager.getLogger(ContainerUploadPage.class); private final UploadWizardState state; private final ImageDetailsRead existingImage; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageCustomPermissionPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageCustomPermissionPage.java index 3a40cb35..8895ebbb 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageCustomPermissionPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageCustomPermissionPage.java @@ -2,7 +2,8 @@ package org.openslx.dozmod.gui.wizard.page; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImagePermissions; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.layout.ImageCustomPermissionPageLayout; @@ -16,7 +17,7 @@ public class ImageCustomPermissionPage extends ImageCustomPermissionPageLayout { */ private static final long serialVersionUID = -8809873730069813731L; - private final static Logger LOGGER = Logger.getLogger(ImageCustomPermissionPage.class); + private final static Logger LOGGER = LogManager.getLogger(ImageCustomPermissionPage.class); private boolean initDone = false; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageOvfConversionPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageOvfConversionPage.java index 8caa4c51..ed3df849 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageOvfConversionPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageOvfConversionPage.java @@ -14,7 +14,8 @@ import javax.swing.JOptionPane; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.I18n; @@ -36,7 +37,7 @@ public class ImageOvfConversionPage extends ImageOvfConversionPageLayout { */ private static final long serialVersionUID = 464428060782110490L; - private final static Logger LOGGER = Logger.getLogger(ImageOvfConversionPage.class); + private final static Logger LOGGER = LogManager.getLogger(ImageOvfConversionPage.class); private UploadWizardState state; private ImageOvfConversionPage page; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java index 1d7f5821..d0b491e3 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadPage.java @@ -16,7 +16,8 @@ import javax.swing.JOptionPane; import javax.swing.filechooser.FileNameExtensionFilter; import org.apache.commons.io.FilenameUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; import org.openslx.bwlp.thrift.iface.Virtualizer; import org.openslx.dozmod.Branding; @@ -58,7 +59,7 @@ public class ImageUploadPage extends ImageUploadPageLayout { */ private static final long serialVersionUID = -2974001512014608455L; - private final static Logger LOGGER = Logger.getLogger(ImageUploadPage.class); + private final static Logger LOGGER = LogManager.getLogger(ImageUploadPage.class); private UploadWizardState state; private String lastDetectedName = null; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java index fdd52efb..7f310f3b 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/ImageUploadSummaryPage.java @@ -3,7 +3,8 @@ package org.openslx.dozmod.gui.wizard.page; import java.awt.KeyboardFocusManager; import java.awt.Window; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.TransferState; import org.openslx.dozmod.Branding; @@ -27,7 +28,7 @@ public class ImageUploadSummaryPage extends ImageUploadSummaryPageLayout { */ private static final long serialVersionUID = -319910198640112507L; - private static final Logger LOGGER = Logger.getLogger(ImageUploadSummaryPage.class); + private static final Logger LOGGER = LogManager.getLogger(ImageUploadSummaryPage.class); private boolean pageIsVisible = false; private boolean uploadListenerAdded = false; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java index bcaa773e..8e82d6bf 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCustomPermissionPage.java @@ -2,7 +2,8 @@ package org.openslx.dozmod.gui.wizard.page; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.LecturePermissions; import org.openslx.dozmod.gui.wizard.Wizard; import org.openslx.dozmod.gui.wizard.layout.LectureCustomPermissionPageLayout; @@ -19,7 +20,7 @@ public class LectureCustomPermissionPage extends LectureCustomPermissionPageLayo */ private static final long serialVersionUID = 8593836578573838805L; - private final static Logger LOGGER = Logger.getLogger(LectureCustomPermissionPage.class); + private final static Logger LOGGER = LogManager.getLogger(LectureCustomPermissionPage.class); private boolean initDone = false; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java index 07146ead..4ec27aad 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/GuiErrorCallback.java @@ -2,7 +2,8 @@ package org.openslx.dozmod.thrift; import java.awt.Frame; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.apache.thrift.transport.TTransportException; import org.openslx.bwlp.thrift.iface.AuthorizationError; @@ -16,7 +17,7 @@ import org.openslx.thrifthelper.ThriftManager.ErrorCallback; public class GuiErrorCallback implements ErrorCallback { - private static final Logger LOGGER = Logger.getLogger(GuiErrorCallback.class); + private static final Logger LOGGER = LogManager.getLogger(GuiErrorCallback.class); private final Frame parent; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ImageLocalDetailsActions.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ImageLocalDetailsActions.java index 0bf1bfcb..6acf7bfe 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ImageLocalDetailsActions.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ImageLocalDetailsActions.java @@ -4,7 +4,8 @@ import java.awt.Frame; import java.nio.ByteBuffer; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImageBaseWrite; import org.openslx.bwlp.thrift.iface.ImageDetailsRead; @@ -24,7 +25,7 @@ import org.openslx.util.QuickTimer.Task; public class ImageLocalDetailsActions implements ImageDetailsActions { - private final static Logger LOGGER = Logger.getLogger(ImageLocalDetailsActions.class); + private final static Logger LOGGER = LogManager.getLogger(ImageLocalDetailsActions.class); private final Frame parent; public ImageLocalDetailsActions(final Frame parent) { this.parent = parent; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java index cf2468b3..fd3920cc 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/Session.java @@ -3,7 +3,8 @@ package org.openslx.dozmod.thrift; import java.util.HashSet; import java.util.Set; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.ImagePermissions; import org.openslx.bwlp.thrift.iface.LecturePermissions; @@ -14,7 +15,7 @@ import org.openslx.thrifthelper.ThriftManager; public class Session { - private static final Logger LOGGER = Logger.getLogger(Session.class); + private static final Logger LOGGER = LogManager.getLogger(Session.class); private static WhoamiInfo data = null; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java index 7d0fde5f..d8efa252 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftActions.java @@ -12,7 +12,8 @@ import java.util.Map; import javax.swing.JFileChooser; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.apache.thrift.transport.TTransportException; import org.openslx.bwlp.thrift.iface.*; @@ -45,7 +46,7 @@ import org.openslx.util.QuickTimer.Task; public class ThriftActions { - private static final Logger LOGGER = Logger.getLogger(ThriftActions.class); + private static final Logger LOGGER = LogManager.getLogger(ThriftActions.class); private static final long SIZE_CHECK_EXTRA_DL = 50l * 1024l * 1024l; /* ******************************************************************************* diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftError.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftError.java index dd69d55c..1da7e835 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftError.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/ThriftError.java @@ -4,7 +4,7 @@ import java.awt.Component; import javax.swing.SwingUtilities; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.AuthorizationError; import org.openslx.bwlp.thrift.iface.InvocationError; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/UploadInitiator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/UploadInitiator.java index 1e4ef05a..777cfcc7 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/UploadInitiator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/UploadInitiator.java @@ -7,7 +7,8 @@ import java.nio.ByteBuffer; import java.security.NoSuchAlgorithmException; import java.util.concurrent.TimeUnit; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.SatelliteStatus; import org.openslx.bwlp.thrift.iface.TAuthorizationException; @@ -21,7 +22,7 @@ import org.openslx.util.QuickTimer; public class UploadInitiator { - private static final Logger LOGGER = Logger.getLogger(UploadInitiator.class); + private static final Logger LOGGER = LogManager.getLogger(UploadInitiator.class); private static final long SIZE_CHECK_EXTRA_UL = 150l * 1024l * 1024l; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/MetaDataCache.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/MetaDataCache.java index 7b6cbe25..32956c71 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/MetaDataCache.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/MetaDataCache.java @@ -3,7 +3,8 @@ package org.openslx.dozmod.thrift.cache; import java.util.ArrayList; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TApplicationException; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.LdapFilter; @@ -21,7 +22,7 @@ import org.openslx.util.GenericDataCache.CacheMode; public class MetaDataCache { - private static final Logger LOGGER = Logger.getLogger(MetaDataCache.class); + private static final Logger LOGGER = LogManager.getLogger(MetaDataCache.class); /** * How long to cache data. diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java index f4e0a430..eb804929 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/OrganizationCache.java @@ -3,7 +3,8 @@ package org.openslx.dozmod.thrift.cache; import java.util.Collections; import java.util.List; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.Organization; import org.openslx.bwlp.thrift.iface.SatelliteServer; import org.openslx.bwlp.thrift.iface.UserInfo; @@ -14,7 +15,7 @@ import org.openslx.util.GenericDataCache.CacheMode; public class OrganizationCache { - private static final Logger LOGGER = Logger.getLogger(OrganizationCache.class); + private static final Logger LOGGER = LogManager.getLogger(OrganizationCache.class); /** * How long should the list be cached? diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/UserCache.java b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/UserCache.java index d3774d58..2cc5516c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/UserCache.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/thrift/cache/UserCache.java @@ -5,7 +5,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.openslx.bwlp.thrift.iface.UserInfo; import org.openslx.dozmod.thrift.Session; @@ -15,7 +16,7 @@ import org.openslx.util.GenericDataCache.CacheMode; public class UserCache { - private static final Logger LOGGER = Logger.getLogger(UserCache.class); + private static final Logger LOGGER = LogManager.getLogger(UserCache.class); /** * How long should the list be cached? diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java index 0ac740b2..8f265a4c 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ClientVersion.java @@ -10,7 +10,8 @@ import java.nio.charset.StandardCharsets; import org.apache.commons.io.FileUtils; import org.apache.commons.io.output.ByteArrayOutputStream; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.App; import org.openslx.dozmod.Branding; import org.openslx.sat.thrift.version.Version; @@ -19,7 +20,7 @@ import org.openslx.util.Json; public class ClientVersion { - private static final Logger LOGGER = Logger.getLogger(ClientVersion.class); + private static final Logger LOGGER = LogManager.getLogger(ClientVersion.class); private static long localRevisionTime = 0; private static long remoteRevisionTime = 0; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java index 87f87131..de72d5b6 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerUtils.java @@ -2,7 +2,8 @@ package org.openslx.dozmod.util; import com.google.gson.JsonArray; import com.google.gson.JsonParser; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.kamranzafar.jtar.TarEntry; import org.kamranzafar.jtar.TarHeader; @@ -36,7 +37,7 @@ import java.util.List; */ public class ContainerUtils { - private static final Logger LOGGER = Logger.getLogger(ContainerUtils.class); + private static final Logger LOGGER = LogManager.getLogger(ContainerUtils.class); /** * Checks ImageBaseId of image if already linked with existing Lectures in diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerWrapper.java index 38ca2477..dd3ee826 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ContainerWrapper.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.util; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.virtualization.configuration.container.ContainerDefinition; @@ -13,7 +14,7 @@ import java.nio.file.Files; public class ContainerWrapper { - private static final Logger LOGGER = Logger.getLogger(ContainerWrapper.class); + private static final Logger LOGGER = LogManager.getLogger(ContainerWrapper.class); public static void unwrapContainer(File tmpDiskFile, String imageName, File destDir, diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ConversionTaskWorker.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ConversionTaskWorker.java index a4e1be54..fb76db88 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ConversionTaskWorker.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ConversionTaskWorker.java @@ -9,14 +9,15 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import javax.swing.SwingWorker; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.I18n; import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.wizard.page.ImageOvfConversionPage; public class ConversionTaskWorker extends SwingWorker<Boolean, String> { - private final static Logger LOGGER = Logger.getLogger(ConversionTaskWorker.class); + private final static Logger LOGGER = LogManager.getLogger(ConversionTaskWorker.class); private File srcFile; private File destFile; diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/DesktopEnvironment.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/DesktopEnvironment.java index 62517e15..6be653de 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/DesktopEnvironment.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/DesktopEnvironment.java @@ -7,7 +7,8 @@ import java.net.URI; import java.net.URLEncoder; import java.util.Arrays; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.App; import org.openslx.dozmod.Branding; @@ -16,7 +17,7 @@ public class DesktopEnvironment { /** * Logger instance for this class */ - private final static Logger LOGGER = Logger.getLogger(DesktopEnvironment.class); + private final static Logger LOGGER = LogManager.getLogger(DesktopEnvironment.class); private static final Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null; public static enum Link { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java index 3c3a5f1c..2c0e6123 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ImageWrapper.java @@ -1,6 +1,7 @@ package org.openslx.dozmod.util; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Branding; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.I18n; @@ -20,7 +21,7 @@ import java.io.IOException; */ public class ImageWrapper { - private static final Logger LOGGER = Logger.getLogger(ImageWrapper.class); + private static final Logger LOGGER = LogManager.getLogger(ImageWrapper.class); /** * @param virtualizerId string constant defined in @link org.openslx.thrifthelper.TConst diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ProxyConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ProxyConfigurator.java index 1e25bbe0..8011eaec 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ProxyConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ProxyConfigurator.java @@ -26,9 +26,9 @@ import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.impl.conn.SystemDefaultRoutePlanner; import org.apache.http.protocol.HttpContext; import org.apache.http.ssl.SSLContexts; -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.log4j.Priority; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.MasterServer; import org.openslx.dozmod.App; import org.openslx.dozmod.authentication.ShibbolethEcp; @@ -51,7 +51,7 @@ public class ProxyConfigurator { /** * Logger for this class */ - private final static Logger LOGGER = Logger.getLogger(ProxyConfigurator.class); + private final static Logger LOGGER = LogManager.getLogger(ProxyConfigurator.class); private static AtomicReference<CloseableHttpClient> apacheClient = new AtomicReference<>(); @@ -90,7 +90,7 @@ public class ProxyConfigurator { com.btr.proxy.util.Logger.setBackend(new LogBackEnd() { public void log(Class<?> clazz, LogLevel loglevel, String msg, Object... params) { - Priority priority; + Level priority; switch (loglevel) { case ERROR: priority = Level.ERROR; @@ -104,7 +104,7 @@ public class ProxyConfigurator { default: priority = Level.DEBUG; } - Logger.getLogger(clazz).log(priority, MessageFormat.format(msg, params)); + LogManager.getLogger(clazz).log(priority, MessageFormat.format(msg, params)); } public boolean isLogginEnabled(LogLevel logLevel) { diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ResourceLoader.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ResourceLoader.java index fee5e7c2..02004cc0 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/ResourceLoader.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/ResourceLoader.java @@ -19,7 +19,8 @@ import javax.swing.Icon; import javax.swing.ImageIcon; import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.dozmod.Config; /** @@ -33,7 +34,7 @@ public class ResourceLoader /** * Logger for this class */ - private final static Logger LOGGER = Logger.getLogger( ResourceLoader.class ); + private final static Logger LOGGER = LogManager.getLogger( ResourceLoader.class ); /** * Load the given resource as an ImageIcon. diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java index 528c8a42..af951d47 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/VmWrapper.java @@ -18,7 +18,8 @@ import javax.management.ReflectionException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.helper.MessageType; @@ -37,7 +38,7 @@ import org.openslx.virtualization.disk.DiskImageVmdk; public class VmWrapper { - private static final Logger LOGGER = Logger.getLogger(VmWrapper.class); + private static final Logger LOGGER = LogManager.getLogger(VmWrapper.class); public static void wrapVm(File diskFile, String imageName, byte[] machineDescription, String virtualizerId, int osId, DiskImage diskImageInfo) throws VirtualizationConfigurationException, diff --git a/dozentenmodul/src/main/properties/log4j.properties b/dozentenmodul/src/main/properties/log4j.properties deleted file mode 100644 index 8fa5e798..00000000 --- a/dozentenmodul/src/main/properties/log4j.properties +++ /dev/null @@ -1,13 +0,0 @@ -# root level logging configuration -log4j.rootLogger=ALL, console - -# NOTE: The file logging appender is added and configured by the Java -# implementation, since the logging file path and logic can only -# be realized by the implementation (using system properties). - -# configuration for console output -log4j.appender.console=org.apache.log4j.ConsoleAppender -log4j.appender.console.layout=org.apache.log4j.PatternLayout -log4j.appender.console.layout.ConversionPattern=[%t] %-5p %F - %m%n -log4j.appender.console.encoding=UTF-8 -log4j.appender.console.Threshold=INFO diff --git a/dozentenmodul/src/main/properties/log4j2.properties b/dozentenmodul/src/main/properties/log4j2.properties new file mode 100644 index 00000000..1b68a76d --- /dev/null +++ b/dozentenmodul/src/main/properties/log4j2.properties @@ -0,0 +1,25 @@ +status=error +name=log4j2PropertiesConfig + +# +# root level logging configuration +# +rootLogger.level=all +rootLogger.appenderRefs=stdout +rootLogger.appenderRef.stdout.ref=logToConsole + +# NOTE: The file logging appender is added and configured by the Java +# implementation, since the logging file path and logic can only +# be realized by the implementation (using system properties). + +# +# configuration for console output +# +appenders=console + +appender.console.type=Console +appender.console.name=logToConsole +appender.console.layout.type=PatternLayout +appender.console.layout.pattern=[%t] %-5p %F - %m%n +appender.console.filter.threshold.type=ThresholdFilter +appender.console.filter.threshold.level=info |