Commit a8eab821 authored by Christian Reuschling's avatar Christian Reuschling
Browse files

log migration to logback | leechCrawler 2.1.0

parent fab71c40
......@@ -2,4 +2,5 @@ target
dynaq.keys
.idea
dynaq.iml
logs/
......@@ -93,28 +93,25 @@
<!-- </dependency>-->
<!-- leechcrawler-->
<dependency>
<groupId>de.dfki.sds</groupId>
<artifactId>leechcrawler</artifactId>
<version>2.0.0</version>
<exclusions>
<exclusion>
<artifactId>asm-debug-all</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
</dependency>
<!-- leechcrawler-->
<dependency>
<groupId>de.dfki.sds</groupId>
<artifactId>leechprojects</artifactId>
<version>0.4-SNAPSHOT</version>
<version>0.5-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>asm-debug-all</artifactId>
<groupId>org.ow2.asm</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- leechcrawler-->
......@@ -219,7 +216,12 @@
<artifactId>json-over-http-delight</artifactId>
<!-- <version>3.0-fluent-alpha1</version> -->
<version>3.0-fluent-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
......
......@@ -13,6 +13,7 @@ import org.apache.lucene.store.Lock;
import org.apache.lucene.store.NativeFSLockFactory;
import org.kafkaRCP.core.KafkaRCPConstants;
import org.kafkaRCP.ui.KafkaRCP;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.io.File;
......@@ -20,7 +21,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.util.Locale;
import java.util.logging.LogManager;
import java.util.logging.Logger;
......@@ -169,14 +169,14 @@ public class DynaQ
if(System.getProperty("os.name").equals("Windows 2000"))
{
System.setProperty("sun.java2d.opengl", "false");
Logger.getLogger(DynaQ.class.getName()).info("Java2D OpenGL acceleration disabled. Windows 2000 don't support this.");
LoggerFactory.getLogger(DynaQ.class.getName()).info("Java2D OpenGL acceleration disabled. Windows 2000 don't support this.");
}
else
Logger.getLogger(DynaQ.class.getName())
LoggerFactory.getLogger(DynaQ.class.getName())
.info("Java2D OpenGL acceleration enabled. Try to start DynaQ with '-Dsun.java2d.opengl=false' if you have GUI trouble.");
}
// else
// Logger.getLogger(DynaQ.class.getName()).info(
// LoggerFactory.getLogger(DynaQ.class.getName()).info(
// "Java2D OpenGL acceleration disabled. Try to start DynaQ with '-Dsun.java2d.opengl=true' for better GUI performance.");
......@@ -197,7 +197,7 @@ public class DynaQ
catch (Throwable t)
{
// Egal, was geworfen wird - wir geben das auch noch am Logger mit aus
Logger.getLogger(DynaQ.class.getName()).severe(ExceptionUtils.createStackTraceString(t));
LoggerFactory.getLogger(DynaQ.class.getName()).error(ExceptionUtils.createStackTraceString(t));
throw t;
}
......
......@@ -22,8 +22,6 @@ import org.apache.lucene.search.Query;
import org.apache.lucene.util.Version;
import org.apache.tika.metadata.Message;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.metadata.PagedText;
import org.apache.tika.metadata.TikaCoreProperties;
import org.dynaq.core.DynaQDocument;
import org.dynaq.core.DynaQException;
import org.dynaq.index.LuceneIndexSet;
......@@ -33,14 +31,13 @@ import org.dynaq.util.lucene.basic.DynaQDefaultFieldConfig;
import org.dynaq.util.lucene.basic.DynamicFieldType;
import org.dynaq.util.lucene.basic.FieldConfig;
import org.kafkaRCP.core.KafkaRCPConstants;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -596,7 +593,7 @@ public class AttributeConfig
}
// Return expanded query.
Logger.getLogger(AttributeConfig.class.getName()).info(numberAttributeQuery.toString());
LoggerFactory.getLogger(AttributeConfig.class.getName()).info(numberAttributeQuery.toString());
return numberAttributeQuery;
......@@ -624,7 +621,7 @@ public class AttributeConfig
}
else
{
Logger.getLogger(AttributeConfig.class.getPackage().getName()).warning("Invalid query mode: \"" + queryMode + "\". Won't create queries.");
LoggerFactory.getLogger(AttributeConfig.class.getPackage().getName()).warn("Invalid query mode: \"" + queryMode + "\". Won't create queries.");
queries = new String[0];
}
......@@ -641,10 +638,10 @@ public class AttributeConfig
}
catch (ParseException e)
{
Logger.getLogger(AttributeConfig.class.getPackage().getName()).warning(
LoggerFactory.getLogger(AttributeConfig.class.getPackage().getName()).warn(
"Couldn't parse field \"" + targetAttributeName + "\" of document \"" + document.getAttributeValue(IndexAttributes.ID)
+ "\". Confer the log file for details.");
Logger.getLogger(AttributeConfig.class.getPackage().getName()).fine(e.getMessage());
LoggerFactory.getLogger(AttributeConfig.class.getPackage().getName()).debug(e.getMessage());
}
}
......@@ -842,7 +839,7 @@ public class AttributeConfig
}
catch (Exception e)
{
Logger.getLogger(AttributeConfig.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(AttributeConfig.class.getName()).error("Error", e);
return new String[0];
}
}
......@@ -1007,7 +1004,7 @@ public class AttributeConfig
}
catch (Exception e)
{
Logger.getLogger(AttributeConfig.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(AttributeConfig.class.getName()).error("Error", e);
}
}
......
......@@ -4,14 +4,14 @@ package org.dynaq.config;
import de.dfki.inquisitor.collections.ConfigurationException;
import de.dfki.inquisitor.collections.MultiValueConfiguration;
import java.util.logging.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConfigurationUtils
{
private static Logger log = Logger.getLogger(ConfigurationUtils.class.getName());
private static Logger log = LoggerFactory.getLogger(ConfigurationUtils.class.getName());
public static <T extends Enum<T>> MultiValueConfiguration getConfiguration(MultiValueConfiguration configuration, Enum<T> key,
MultiValueConfiguration defaultValue)
......@@ -29,7 +29,7 @@ public class ConfigurationUtils
}
catch (ConfigurationException e)
{
log.fine("Getting unique configuration value for key " + key + " failed: " + e.getMessage());
log.debug("Getting unique configuration value for key " + key + " failed: " + e.getMessage());
return defaultValue;
}
}
......@@ -51,7 +51,7 @@ public class ConfigurationUtils
}
catch (ConfigurationException e)
{
log.fine("Getting unique double value for key " + key + " failed: " + e.getMessage());
log.debug("Getting unique double value for key " + key + " failed: " + e.getMessage());
return defaultValue;
}
}
......@@ -73,7 +73,7 @@ public class ConfigurationUtils
}
catch (ConfigurationException e)
{
log.fine("Getting unique float value for key " + key + " failed: " + e.getMessage());
log.debug("Getting unique float value for key " + key + " failed: " + e.getMessage());
return defaultValue;
}
}
......@@ -95,7 +95,7 @@ public class ConfigurationUtils
}
catch (ConfigurationException e)
{
log.fine("Getting unique integer value for key " + key + " failed: " + e.getMessage());
log.debug("Getting unique integer value for key " + key + " failed: " + e.getMessage());
return defaultValue;
}
}
......@@ -117,7 +117,7 @@ public class ConfigurationUtils
}
catch (ConfigurationException e)
{
log.fine("Getting unique string value for key " + key + " failed: " + e.getMessage());
log.debug("Getting unique string value for key " + key + " failed: " + e.getMessage());
return defaultValue;
}
}
......
......@@ -3,9 +3,10 @@ package org.dynaq.config;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.logging.Logger;
......@@ -57,7 +58,7 @@ public class DynaQConstants
catch (IOException e)
{
Logger.getLogger(DynaQConstants.class.getName()).warning(
LoggerFactory.getLogger(DynaQConstants.class.getName()).warn(
"Error during the creation of an canonical path for '" + strNewBasePath + "' Will return the absolute path." + e.getMessage());
strNewPath = fNewFile.getAbsolutePath();
......
......@@ -6,6 +6,7 @@ import de.dfki.inquisitor.collections.MultiValueConfiguration;
import org.dynaq.config.AttributeConfig.ConfigAttributes;
import org.dynaq.config.AttributeConfig.ConfigAttributes.IMAP_DIRECTORY_ATTS;
import org.kafkaRCP.core.KafkaRCPConstants;
import org.slf4j.LoggerFactory;
import javax.mail.Folder;
import javax.mail.MessagingException;
......@@ -16,8 +17,6 @@ import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -321,7 +320,7 @@ public class ImapServerSplitPane extends JSplitPane implements ActionListener
catch (MessagingException e)
{
// Fehlermeldung zeigen
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error while connecting server", e);
LoggerFactory.getLogger(this.getClass().getName()).error("Error while connecting server", e);
JOptionPane.showMessageDialog(this, "Connection not successful! Please check your data.", "Sorry", JOptionPane.ERROR_MESSAGE);
}
}
......
......@@ -13,6 +13,7 @@ import org.kafkaRCP.core.RCPGlobalMessageListener;
import org.kafkaRCP.core.RCPPersistentPlugin;
import org.kafkaRCP.core.data.KafkaMessages;
import org.kafkaRCP.ui.KafkaRCP;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.event.InternalFrameEvent;
......@@ -20,11 +21,8 @@ import javax.swing.event.InternalFrameListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.Hashtable;
import java.util.logging.Logger;
......@@ -224,38 +222,38 @@ public class ImportConfigView extends JPanel implements ActionListener, RCPPersi
m_startIndexingButton.addActionListener(this);
// die ProgressBar
m_indexingProgressBar.addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
EventQueue.invokeLater(new Runnable()
{
@Override
public void run()
{
try
{
// wir öffnen eine Konsole, wenn auf das Teil geklick wird - das nervt mich schon seit ewigen Zeiten
JInternalFrame consoleFrame = KafkaRCP.showView("./plugins/views/Basic/Console", null);
if(consoleFrame.getDesktopPane() == null) return;
Rectangle desktopPaneBounds = consoleFrame.getDesktopPane().getBounds();
int iConsoleHeight = Math.min(desktopPaneBounds.height - 400, desktopPaneBounds.height / 2);
consoleFrame.setLocation(0, iConsoleHeight);
consoleFrame.setPreferredSize(new Dimension(desktopPaneBounds.width, desktopPaneBounds.height - iConsoleHeight));
}
catch (Exception ex)
{
throw new RuntimeException(ex);
}
}
});
}
});
// m_indexingProgressBar.addMouseListener(new MouseAdapter()
// {
//
// @Override
// public void mouseClicked(MouseEvent e)
// {
// EventQueue.invokeLater(new Runnable()
// {
// @Override
// public void run()
// {
// try
// {
// // wir öffnen eine Konsole, wenn auf das Teil geklick wird - das nervt mich schon seit ewigen Zeiten
// JInternalFrame consoleFrame = KafkaRCP.showView("./plugins/views/Basic/Console", null);
// if(consoleFrame.getDesktopPane() == null) return;
// Rectangle desktopPaneBounds = consoleFrame.getDesktopPane().getBounds();
//
// int iConsoleHeight = Math.min(desktopPaneBounds.height - 400, desktopPaneBounds.height / 2);
// consoleFrame.setLocation(0, iConsoleHeight);
// consoleFrame.setPreferredSize(new Dimension(desktopPaneBounds.width, desktopPaneBounds.height - iConsoleHeight));
//
// }
// catch (Exception ex)
// {
// throw new RuntimeException(ex);
// }
// }
// });
// }
//
// });
// * das Layout
......@@ -299,8 +297,8 @@ public class ImportConfigView extends JPanel implements ActionListener, RCPPersi
// Play animation
m_indexingProgressBar.setIndeterminate(true);
m_indexingProgressBar.setString("Click for detail Console View");
m_indexingProgressBar.setStringPainted(true);
// m_indexingProgressBar.setString("Click for detail Console View");
// m_indexingProgressBar.setStringPainted(true);
SwingUtilities.updateComponentTreeUI(this);
}
......@@ -366,7 +364,7 @@ public class ImportConfigView extends JPanel implements ActionListener, RCPPersi
}
catch (Exception e)
{
Logger.getLogger(this.getClass().getName()).severe(ExceptionUtils.createStackTraceString(e));
LoggerFactory.getLogger(this.getClass().getName()).error(ExceptionUtils.createStackTraceString(e));
JOptionPane.showMessageDialog(ImportConfigView.this, "Error during indexing:\n" + ExceptionUtils.createStackTraceString(e),
"Indexer", JOptionPane.ERROR_MESSAGE);
}
......
......@@ -13,6 +13,7 @@ import org.kafkaRCP.core.RCPGlobalMessageListener;
import org.kafkaRCP.core.RCPPersistentPlugin;
import org.kafkaRCP.core.data.KafkaMessages;
import org.kafkaRCP.ui.KafkaRCP;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import javax.swing.event.InternalFrameEvent;
......@@ -27,8 +28,6 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -279,7 +278,7 @@ public class IndicesConfigView extends JPanel implements ActionListener, RCPPers
}
catch (Exception e)
{
Logger.getLogger(IndicesConfigView.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(IndicesConfigView.class.getName()).error("Error", e);
JOptionPane.showMessageDialog(this, "Sorry - error during opening an external index under '" + selectedFile.getAbsolutePath()
+ "'\n cause of:\n" + e.getMessage(), "error", JOptionPane.ERROR_MESSAGE);
......
......@@ -18,6 +18,7 @@ import org.dynaq.util.lucene.basic.Buzzwords;
import org.dynaq.util.lucene.basic.IndexAccessor;
import org.dynaq.util.lucene.basic.RemoteIndexSearcher;
import org.dynaq.util.lucene.basic.URINotFoundException;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
......@@ -27,7 +28,6 @@ import java.io.Serializable;
import java.net.URISyntaxException;
import java.util.*;
import java.util.Map.Entry;
import java.util.logging.Logger;
......@@ -51,7 +51,7 @@ public class DynaQDocument implements Serializable
m_attributeConfig = new AttributeConfig();
} catch (Exception e)
{
Logger.getLogger(DynaQQuery.class.getName()).severe(ExceptionUtils.createStackTraceString(e));
LoggerFactory.getLogger(DynaQQuery.class.getName()).error(ExceptionUtils.createStackTraceString(e));
}
}
......
......@@ -19,6 +19,7 @@ import org.dynaq.util.lucene.BooleanQueryWithMetaData;
import org.dynaq.util.lucene.BoostedQueriesExtractor;
import org.dynaq.util.lucene.basic.LuceneUtilz;
import org.dynaq.util.swing.ColorFactory;
import org.slf4j.LoggerFactory;
import java.awt.*;
import java.io.IOException;
......@@ -26,8 +27,6 @@ import java.io.Serializable;
import java.net.URISyntaxException;
import java.util.List;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -51,7 +50,7 @@ public class DynaQQuery implements Serializable
}
catch (Exception e)
{
Logger.getLogger(DynaQQuery.class.getName()).severe(ExceptionUtils.createStackTraceString(e));
LoggerFactory.getLogger(DynaQQuery.class.getName()).error(ExceptionUtils.createStackTraceString(e));
}
}
......@@ -151,7 +150,7 @@ public class DynaQQuery implements Serializable
}
catch (Exception e)
{
Logger.getLogger(DynaQQuery.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(DynaQQuery.class.getName()).error("Error", e);
return null;
}
......@@ -723,7 +722,7 @@ public class DynaQQuery implements Serializable
}
catch (NumberFormatException e)
{
Logger.getLogger(DynaQQuery.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(DynaQQuery.class.getName()).error("Error", e);
return null;
}
......@@ -967,7 +966,7 @@ public class DynaQQuery implements Serializable
}
catch (Exception e)
{
Logger.getLogger(DynaQQuery.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(DynaQQuery.class.getName()).error("Error", e);
}
......@@ -1127,7 +1126,7 @@ public class DynaQQuery implements Serializable
}
catch (Exception e)
{
Logger.getLogger(DynaQQuery.class.getName()).log(Level.SEVERE, "Error", e);
LoggerFactory.getLogger(DynaQQuery.class.getName()).error("Error", e);
}
return hsTerm2Color;
......
......@@ -13,10 +13,10 @@ import org.dynaq.core.weaving.TermRelevancesScoreDoc;
import org.dynaq.index.LuceneIndexSet;
import org.dynaq.util.lucene.basic.IndexAccessor;
import org.dynaq.util.lucene.basic.RemoteIndexSearcher;
import org.slf4j.LoggerFactory;
import javax.mail.MethodNotSupportedException;
import java.util.*;
import java.util.logging.Logger;
......@@ -138,7 +138,7 @@ public class DynaQResultList implements Iterable<ScoredDynaQDocument>
// das einzige Argument ist der index des Dokuments - und wenn der nicht mehr gültig ist, dann ist das Ding wahrscheinlich
// gelöscht
Logger.getLogger(this.getClass().getName()).fine(ExceptionUtils.createStackTraceString(e));
LoggerFactory.getLogger(this.getClass().getName()).debug(ExceptionUtils.createStackTraceString(e));
}
catch (Exception e)
......
......@@ -7,9 +7,9 @@ import de.dfki.inquisitor.exceptions.ExceptionUtils;
import org.dynaq.config.DynaQConstants;
import org.kafkaRCP.core.KafkaRCPConstants;
import org.kafkaRCP.ui.KafkaRCP;
import org.slf4j.LoggerFactory;
import javax.swing.*;
import java.util.logging.Logger;
......@@ -28,7 +28,7 @@ public class StartupRunnablePlugin implements Runnable
}
catch (Exception e)
{
Logger.getLogger(this.getClass().getName()).severe(ExceptionUtils.createStackTraceString(e));
LoggerFactory.getLogger(this.getClass().getName()).error(ExceptionUtils.createStackTraceString(e));
}
}
......
......@@ -9,11 +9,11 @@ import javassist.CtClass;
import javassist.NotFoundException;
import org.dynaq.DynaQ;
import org.dynaq.core.DynaQException;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.LinkedList;
import java.util.logging.Logger;
......@@ -66,11 +66,11 @@ public class DynaQClassWeaver
llClasses2Load.addAll(TermRelevancesCollector.weaveClasses(classPool));
Logger.getLogger(DynaQ.class.getName()).info("..will delete old classes from disk");
LoggerFactory.getLogger(DynaQ.class.getName()).info("..will delete old classes from disk");
FileUtilz.deleteDirectory(new File("weavedClasses/org"));
Logger.getLogger(DynaQ.class.getName()).info("..will write weaved classes to disk");
LoggerFactory.getLogger(DynaQ.class.getName()).info("..will write weaved classes to disk");
for (CtClass weavedClass : llClasses2Load)
{
......@@ -83,7 +83,7 @@ public class DynaQClassWeaver
weavedClass.writeFile("weavedClasses");
}
Logger.getLogger(DynaQ.class.getName()).info("..done");
LoggerFactory.getLogger(DynaQ.class.getName()).info("..done");
bClassesWeaved = true;
......
......@@ -9,13 +9,12 @@ import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.*;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.util.Version;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
......@@ -555,7 +554,7 @@ public class TermRelevancesCollector
// wenn wir die Teile schon an irgendeiner Stelle modifiziert haben, dann machen wir hier gar nix
if(queryClass.isFrozen())
{
Logger.getLogger(TermRelevancesCollector.class.getName()).fine("Lucene classes already weaved by javassist. Will skip second weaving.");
LoggerFactory.getLogger(TermRelevancesCollector.class.getName()).debug("Lucene classes already weaved by javassist. Will skip second weaving.");
return llWeavedClasses;
}
......@@ -750,7 +749,7 @@ public class TermRelevancesCollector
}
catch (Exception e)
{
Logger.getLogger(TermRelevancesCollector.class.getName()).log(Level.SEVERE, "weaving " + strSearcherClassname, e);
LoggerFactory.getLogger(TermRelevancesCollector.class.getName()).error("weaving " + strSearcherClassname, e);