diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java index 8a496d8fac..e0b1ec8f01 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/IngestJobInfoPanel.java @@ -25,12 +25,11 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.JOptionPane; -import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.table.AbstractTableModel; import org.openide.util.NbBundle.Messages; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.IngestJobInfo; import org.sleuthkit.datamodel.IngestModuleInfo; diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java index 49ae86d62b..c0043d9ba1 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017-18 Basis Technology Corp. + * Copyright 2017-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,9 +21,9 @@ package org.sleuthkit.autopsy.communications; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; -import java.util.logging.Logger; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Account; import org.sleuthkit.datamodel.AccountDeviceInstance; import org.sleuthkit.datamodel.CommunicationsFilter; diff --git a/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java b/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java index 9b2afff6b4..f52ed088ae 100644 --- a/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java +++ b/Core/src/org/sleuthkit/autopsy/coordinationservice/CoordinationService.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,8 +25,6 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.annotation.concurrent.GuardedBy; import javax.annotation.concurrent.ThreadSafe; import org.apache.curator.RetryPolicy; diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/CreditCards.java b/Core/src/org/sleuthkit/autopsy/datamodel/CreditCards.java index d353df6c88..7582846866 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/CreditCards.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/CreditCards.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,12 +25,12 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.Optional; import java.util.logging.Level; -import java.util.logging.Logger; import javax.annotation.concurrent.GuardedBy; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import org.apache.commons.lang3.StringUtils; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.datamodel.accounts.BINRange; @@ -108,7 +108,7 @@ public class CreditCards { Optional getScheme(); } - private static final Logger LOGGER = Logger.getLogger(CreditCards.class.getName()); + private static final Logger logger = Logger.getLogger(CreditCards.class.getName()); /** @@ -166,12 +166,12 @@ public class CreditCards { binRanges.put(Range.closed(binRange.getBINstart(), binRange.getBINend()), binRange); } catch (NumberFormatException numberFormatException) { - LOGGER.log(Level.WARNING, "Failed to parse BIN range: " + record.toString(), numberFormatException); //NON-NLS + logger.log(Level.WARNING, "Failed to parse BIN range: " + record.toString(), numberFormatException); //NON-NLS } binsLoaded = true; } } catch (IOException ex) { - LOGGER.log(Level.WARNING, "Failed to load BIN ranges form ranges.csv", ex); //NON-NLS + logger.log(Level.WARNING, "Failed to load BIN ranges form ranges.csv", ex); //NON-NLS MessageNotifyUtil.Notify.warn("Credit Card Number Discovery", "There was an error loading Bank Identification Number information. Accounts will not have their BINs identified."); } } diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java index 3b6878ce23..72d2999a98 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/accounts/Accounts.java @@ -40,7 +40,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.logging.Level; -import java.util.logging.Logger; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Nonnull; @@ -60,6 +59,7 @@ import org.openide.util.lookup.Lookups; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.datamodel.AutopsyItemVisitor; import org.sleuthkit.autopsy.datamodel.AutopsyVisitableItem; import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsAction.java index a2c268a518..44d5fd91fc 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsAction.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2017 Basis Technology Corp. + * Copyright 2017-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,17 +18,15 @@ */ package org.sleuthkit.autopsy.directorytree; -import java.awt.Dimension; -import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.AbstractAction; import javax.swing.JDialog; import javax.swing.JFrame; import org.openide.util.NbBundle; import org.openide.windows.WindowManager; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.Volume; import org.sleuthkit.datamodel.TskCoreException; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java index f896fa0dad..ce5b915b41 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/FileSystemDetailsPanel.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.directorytree; import java.awt.event.ActionListener; import java.util.logging.Level; -import java.util.logging.Logger; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.FileSystem; import org.sleuthkit.datamodel.Volume; import org.sleuthkit.datamodel.TskCoreException; diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java index 04a2cccc2c..494908285b 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/ViewSourceArtifactAction.java @@ -20,10 +20,10 @@ package org.sleuthkit.autopsy.directorytree; import java.awt.event.ActionEvent; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.AbstractAction; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.BlackboardArtifact; import org.sleuthkit.datamodel.BlackboardAttribute; import org.sleuthkit.datamodel.TskCoreException; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java index 6a6d70677f..d03616d6f0 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettingsPanel.java @@ -27,7 +27,6 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.logging.Level; -import java.util.logging.Logger; import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; import javax.swing.ImageIcon; @@ -45,6 +44,7 @@ import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.modules.interestingitems.FilesSet; import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel; import org.sleuthkit.autopsy.modules.interestingitems.FilesSetPanel; diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index e4c5c41340..1dc585a8f3 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -46,7 +46,7 @@ public final class IngestMonitor { public static final int DISK_FREE_SPACE_UNKNOWN = -1; private static final int INITIAL_INTERVAL_MS = 60000; //1 min. private static final int MAX_LOG_FILES = 3; - private static final java.util.logging.Logger MONITOR_LOGGER = java.util.logging.Logger.getLogger("monitor"); //NON-NLS + private static final java.util.logging.Logger monitorLogger = java.util.logging.Logger.getLogger("monitor"); //NON-NLS private final Logger logger = Logger.getLogger(IngestMonitor.class.getName()); private Timer timer; private MonitorTimerAction timerAction; @@ -63,8 +63,8 @@ public final class IngestMonitor { FileHandler monitorLogHandler = new FileHandler(PlatformUtil.getUserDirectory().getAbsolutePath() + "/var/log/monitor.log", 0, MAX_LOG_FILES); //NON-NLS monitorLogHandler.setFormatter(new SimpleFormatter()); monitorLogHandler.setEncoding(PlatformUtil.getLogFileEncoding()); - MONITOR_LOGGER.setUseParentHandlers(false); - MONITOR_LOGGER.addHandler(monitorLogHandler); + monitorLogger.setUseParentHandlers(false); + monitorLogger.addHandler(monitorLogHandler); } catch (IOException | SecurityException ex) { logger.log(Level.SEVERE, "Failed to create memory usage logger", ex); //NON-NLS } @@ -202,7 +202,7 @@ public final class IngestMonitor { IngestServices.getInstance().postMessage(IngestMessage.createManagerErrorMessage( NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.title", diskPath), NbBundle.getMessage(this.getClass(), "IngestMonitor.mgrErrMsg.lowDiskSpace.msg", diskPath))); - MONITOR_LOGGER.log(Level.SEVERE, "Stopping ingest due to low disk space on {0}", diskPath); //NON-NLS + monitorLogger.log(Level.SEVERE, "Stopping ingest due to low disk space on {0}", diskPath); //NON-NLS logger.log(Level.SEVERE, "Stopping ingest due to low disk space on {0}", diskPath); //NON-NLS } } @@ -211,7 +211,7 @@ public final class IngestMonitor { * Writes current message usage to the memory usage log. */ private void logMemoryUsage() { - MONITOR_LOGGER.log(Level.INFO, PlatformUtil.getAllMemUsageInfo()); + monitorLogger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo()); } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java index d097882053..3b7d91331f 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestControlPanel.java @@ -43,7 +43,6 @@ import java.io.File; import java.util.HashSet; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTable; @@ -60,6 +59,7 @@ import org.openide.util.NbBundle; import org.openide.util.NbBundle.Messages; import org.openide.windows.WindowManager; import org.sleuthkit.autopsy.core.ServicesMonitor; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.NetworkUtils; import org.sleuthkit.autopsy.coreutils.PlatformUtil; @@ -141,7 +141,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { private static final int COMPLETED_TIME_COL_PREFERRED_WIDTH = 280; private static final String UPDATE_TASKS_THREAD_NAME = "AID-update-tasks-%d"; private static final String LOCAL_HOST_NAME = NetworkUtils.getLocalHostName(); - private static final Logger SYS_LOGGER = AutoIngestSystemLogger.getLogger(); + private static final Logger sysLogger = AutoIngestSystemLogger.getLogger(); private static AutoIngestControlPanel instance; private final DefaultTableModel pendingTableModel; private final DefaultTableModel runningTableModel; @@ -333,7 +333,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { serviceStatus = NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.tbServicesStatusMessage.Message.Down"); } } catch (ServicesMonitor.ServicesMonitorException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Dashboard error getting service status for %s", service), ex); + sysLogger.log(Level.SEVERE, String.format("Dashboard error getting service status for %s", service), ex); } return serviceStatus; } @@ -687,7 +687,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { manager.startUp(); autoIngestStarted = true; } catch (AutoIngestManager.AutoIngestManagerException ex) { - SYS_LOGGER.log(Level.SEVERE, "Dashboard error starting up auto ingest", ex); + sysLogger.log(Level.SEVERE, "Dashboard error starting up auto ingest", ex); tbStatusMessage.setText(NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.AutoIngestStartupError")); manager = null; @@ -712,7 +712,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { status = NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.tbServicesStatusMessage.Message.Up"); } else if (status.equals(ServicesMonitor.ServiceStatus.DOWN.toString())) { status = NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.tbServicesStatusMessage.Message.Down"); - SYS_LOGGER.log(Level.SEVERE, "Connection to {0} is down", serviceDisplayName); //NON-NLS + sysLogger.log(Level.SEVERE, "Connection to {0} is down", serviceDisplayName); //NON-NLS } // if the status update is for an existing service who's status hasn't changed - do nothing. @@ -1187,7 +1187,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { job.getPriority()}); // PRIORITY } } catch (Exception ex) { - SYS_LOGGER.log(Level.SEVERE, "Dashboard error refreshing table", ex); + sysLogger.log(Level.SEVERE, "Dashboard error refreshing table", ex); } } @@ -1823,7 +1823,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { try { manager.prioritizeCase(caseName); } catch (AutoIngestManager.AutoIngestManagerException ex) { - SYS_LOGGER.log(Level.SEVERE, "Error prioritizing a case", ex); + sysLogger.log(Level.SEVERE, "Error prioritizing a case", ex); MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_casePrioritization()); } refreshTables(); @@ -1862,7 +1862,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { } } } catch (IOException ex) { - SYS_LOGGER.log(Level.SEVERE, "Dashboard error attempting to display case auto ingest log", ex); + sysLogger.log(Level.SEVERE, "Dashboard error attempting to display case auto ingest log", ex); Object[] options = {org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "DisplayLogDialog.okay")}; JOptionPane.showOptionDialog(this, org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "DisplayLogDialog.cannotFindLog"), @@ -1883,7 +1883,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { try { manager.prioritizeJob(manifestFilePath); } catch (AutoIngestManager.AutoIngestManagerException ex) { - SYS_LOGGER.log(Level.SEVERE, "Error prioritizing a job", ex); + sysLogger.log(Level.SEVERE, "Error prioritizing a job", ex); MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_jobPrioritization()); } refreshTables(); @@ -1930,7 +1930,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { try { manager.deprioritizeCase(caseName); } catch (AutoIngestManager.AutoIngestManagerException ex) { - SYS_LOGGER.log(Level.SEVERE, "Error deprioritizing a case", ex); + sysLogger.log(Level.SEVERE, "Error deprioritizing a case", ex); MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_caseDeprioritization()); } refreshTables(); @@ -1949,7 +1949,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer { try { manager.deprioritizeJob(manifestFilePath); } catch (AutoIngestManager.AutoIngestManagerException ex) { - SYS_LOGGER.log(Level.SEVERE, "Error deprioritizing a job", ex); + sysLogger.log(Level.SEVERE, "Error deprioritizing a job", ex); MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_jobDeprioritization()); } refreshTables(); diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java index cc162494ae..8a1228cde4 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestManager.java @@ -76,6 +76,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback.DataSourceProcessorResult; import static org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorCallback.DataSourceProcessorResult.CRITICAL_ERRORS; import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgressMonitor; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.NetworkUtils; import org.sleuthkit.autopsy.events.AutopsyEvent; import org.sleuthkit.autopsy.events.AutopsyEventException; @@ -137,7 +138,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private static final String JOB_STATUS_PUBLISHING_THREAD_NAME = "AIM-job-status-event-publisher-%d"; private static final long MAX_MISSED_JOB_STATUS_UPDATES = 10; private static final int DEFAULT_PRIORITY = 0; - private static final java.util.logging.Logger SYS_LOGGER = AutoIngestSystemLogger.getLogger(); + private static final Logger sysLogger = AutoIngestSystemLogger.getLogger(); private static AutoIngestManager instance; private final AutopsyEventPublisher eventPublisher; private final Object scanMonitor; @@ -184,7 +185,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * designated input directory tree. */ private AutoIngestManager() { - SYS_LOGGER.log(Level.INFO, "Initializing auto ingest"); + sysLogger.log(Level.INFO, "Initializing auto ingest"); state = State.IDLE; eventPublisher = new AutopsyEventPublisher(); scanMonitor = new Object(); @@ -200,9 +201,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen completedJobs = new ArrayList<>(); try { RuntimeProperties.setRunningWithGUI(false); - SYS_LOGGER.log(Level.INFO, "Set running with desktop GUI runtime property to false"); + sysLogger.log(Level.INFO, "Set running with desktop GUI runtime property to false"); } catch (RuntimeProperties.RuntimePropertiesException ex) { - SYS_LOGGER.log(Level.SEVERE, "Failed to set running with desktop GUI runtime property to false", ex); + sysLogger.log(Level.SEVERE, "Failed to set running with desktop GUI runtime property to false", ex); } } @@ -213,7 +214,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * ingest. */ void startUp() throws AutoIngestManagerException { - SYS_LOGGER.log(Level.INFO, "Auto ingest starting"); + sysLogger.log(Level.INFO, "Auto ingest starting"); try { coordinationService = CoordinationService.getInstance(); } catch (CoordinationServiceException ex) { @@ -221,9 +222,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } try { eventPublisher.openRemoteEventChannel(EVENT_CHANNEL_NAME); - SYS_LOGGER.log(Level.INFO, "Opened auto ingest event channel"); + sysLogger.log(Level.INFO, "Opened auto ingest event channel"); } catch (AutopsyEventException ex) { - SYS_LOGGER.log(Level.SEVERE, "Failed to open auto ingest event channel", ex); + sysLogger.log(Level.SEVERE, "Failed to open auto ingest event channel", ex); throw new AutoIngestManagerException("Failed to open auto ingest event channel", ex); } rootInputDirectory = Paths.get(AutoIngestUserPreferences.getAutoModeImageFolder()); @@ -396,7 +397,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen if (State.RUNNING != state) { return; } - SYS_LOGGER.log(Level.INFO, "Auto ingest shutting down"); + sysLogger.log(Level.INFO, "Auto ingest shutting down"); state = State.SHUTTING_DOWN; try { eventPublisher.removeSubscriber(EVENT_LIST, instance); @@ -406,9 +407,9 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen cleanupJobs(); } catch (InterruptedException ex) { - SYS_LOGGER.log(Level.SEVERE, "Auto ingest interrupted during shut down", ex); + sysLogger.log(Level.SEVERE, "Auto ingest interrupted during shut down", ex); } - SYS_LOGGER.log(Level.INFO, "Auto ingest shut down"); + sysLogger.log(Level.INFO, "Auto ingest shut down"); state = State.IDLE; } @@ -420,10 +421,10 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen inputScanSchedulingExecutor.shutdownNow(); inputScanExecutor.shutdownNow(); while (!inputScanSchedulingExecutor.awaitTermination(30, TimeUnit.SECONDS)) { - SYS_LOGGER.log(Level.WARNING, "Auto ingest waited at least thirty seconds for input scan scheduling executor to shut down, continuing to wait"); //NON-NLS + sysLogger.log(Level.WARNING, "Auto ingest waited at least thirty seconds for input scan scheduling executor to shut down, continuing to wait"); //NON-NLS } while (!inputScanExecutor.awaitTermination(30, TimeUnit.SECONDS)) { - SYS_LOGGER.log(Level.WARNING, "Auto ingest waited at least thirty seconds for input scan executor to shut down, continuing to wait"); //NON-NLS + sysLogger.log(Level.WARNING, "Auto ingest waited at least thirty seconds for input scan executor to shut down, continuing to wait"); //NON-NLS } } @@ -439,7 +440,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen jobProcessingExecutor.shutdown(); } while (!jobProcessingExecutor.awaitTermination(30, TimeUnit.SECONDS)) { - SYS_LOGGER.log(Level.WARNING, "Auto ingest waited at least thirty seconds for job processing executor to shut down, continuing to wait"); //NON-NLS + sysLogger.log(Level.WARNING, "Auto ingest waited at least thirty seconds for job processing executor to shut down, continuing to wait"); //NON-NLS } } @@ -506,11 +507,11 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen if (State.RUNNING != state) { return; } - SYS_LOGGER.log(Level.INFO, "Starting input scan of {0}", rootInputDirectory); + sysLogger.log(Level.INFO, "Starting input scan of {0}", rootInputDirectory); InputDirScanner scanner = new InputDirScanner(); scanner.scan(); - SYS_LOGGER.log(Level.INFO, "Completed input scan of {0}", rootInputDirectory); + sysLogger.log(Level.INFO, "Completed input scan of {0}", rootInputDirectory); } /** @@ -772,10 +773,10 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen updateCoordinationServiceManifestNode(completedJob); pendingJobs.add(completedJob); } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Coordination service error while reprocessing %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Coordination service error while reprocessing %s", manifestPath), ex); completedJobs.add(completedJob); } catch (InterruptedException ex) { - SYS_LOGGER.log(Level.SEVERE, "Unexpected interrupt while updating coordination service node data for {0}", manifestPath); + sysLogger.log(Level.SEVERE, "Unexpected interrupt while updating coordination service node data for {0}", manifestPath); completedJobs.add(completedJob); } } @@ -811,7 +812,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { metaData = new CaseMetadata(caseMetaDataFilePath); } catch (CaseMetadata.CaseMetadataException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Failed to get case metadata file %s for case %s at %s", caseMetaDataFilePath, caseName, caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Failed to get case metadata file %s for case %s at %s", caseMetaDataFilePath, caseName, caseDirectoryPath), ex); return CaseDeletionResult.FAILED; } @@ -822,7 +823,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen scanner.scan(); Set manifestPaths = casesToManifests.get(caseName); if (null == manifestPaths) { - SYS_LOGGER.log(Level.SEVERE, String.format("No manifest paths found for case %s at %s", caseName, caseDirectoryPath)); + sysLogger.log(Level.SEVERE, String.format("No manifest paths found for case %s at %s", caseName, caseDirectoryPath)); return CaseDeletionResult.FAILED; } @@ -840,7 +841,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen return CaseDeletionResult.FAILED; } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to acquire manifest lock for %s for case %s at %s", manifestPath, caseName, caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to acquire manifest lock for %s for case %s at %s", manifestPath, caseName, caseDirectoryPath), ex); return CaseDeletionResult.FAILED; } } @@ -851,7 +852,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ Case.deleteCase(metaData); } catch (CaseActionException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Failed to physically delete case %s at %s", caseName, caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Failed to physically delete case %s at %s", caseName, caseDirectoryPath), ex); return CaseDeletionResult.FAILED; } @@ -865,10 +866,10 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen deletedJob.setProcessingStatus(AutoIngestJob.ProcessingStatus.DELETED); this.updateCoordinationServiceManifestNode(deletedJob); } catch (AutoIngestJobNodeData.InvalidDataException | AutoIngestJobException ex) { - SYS_LOGGER.log(Level.WARNING, String.format("Invalid auto ingest job node data for %s", manifestPath), ex); + sysLogger.log(Level.WARNING, String.format("Invalid auto ingest job node data for %s", manifestPath), ex); return CaseDeletionResult.PARTIALLY_DELETED; } catch (InterruptedException | CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set delete flag on manifest data for %s for case %s at %s", manifestPath, caseName, caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to set delete flag on manifest data for %s for case %s at %s", manifestPath, caseName, caseDirectoryPath), ex); return CaseDeletionResult.PARTIALLY_DELETED; } } @@ -895,7 +896,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { lock.release(); } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Failed to release manifest file lock when deleting case %s at %s", caseName, caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Failed to release manifest file lock when deleting case %s at %s", caseName, caseDirectoryPath), ex); } } } @@ -944,7 +945,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen synchronized (jobsLock) { if (null != currentJob) { currentJob.cancel(); - SYS_LOGGER.log(Level.INFO, "Cancelling automated ingest for manifest {0}", currentJob.getManifest().getFilePath()); + sysLogger.log(Level.INFO, "Cancelling automated ingest for manifest {0}", currentJob.getManifest().getFilePath()); } } } @@ -965,7 +966,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen if (null != moduleHandle) { currentJob.setProcessingStage(AutoIngestJob.Stage.CANCELLING_MODULE, Date.from(Instant.now())); moduleHandle.cancel(); - SYS_LOGGER.log(Level.INFO, "Cancelling {0} module for manifest {1}", new Object[]{moduleHandle.displayName(), currentJob.getManifest().getFilePath()}); + sysLogger.log(Level.INFO, "Cancelling {0} module for manifest {1}", new Object[]{moduleHandle.displayName(), currentJob.getManifest().getFilePath()}); } } } @@ -1015,7 +1016,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * input directory scan task executor. */ private InputDirScanSchedulingTask() { - SYS_LOGGER.log(Level.INFO, "Periodic input scan scheduling task started"); + sysLogger.log(Level.INFO, "Periodic input scan scheduling task started"); } /** @@ -1045,10 +1046,10 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen if (Thread.currentThread().isInterrupted()) { return null; } - SYS_LOGGER.log(Level.INFO, "Starting input scan of {0}", rootInputDirectory); + sysLogger.log(Level.INFO, "Starting input scan of {0}", rootInputDirectory); InputDirScanner scanner = new InputDirScanner(); scanner.scan(); - SYS_LOGGER.log(Level.INFO, "Completed input scan of {0}", rootInputDirectory); + sysLogger.log(Level.INFO, "Completed input scan of {0}", rootInputDirectory); setChanged(); notifyObservers(Event.INPUT_SCAN_COMPLETED); return null; @@ -1090,7 +1091,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * uncaught exceptions will propagate up to the calling * thread and may stop it from running. */ - SYS_LOGGER.log(Level.SEVERE, String.format("Error scanning the input directory %s", rootInputDirectory), ex); + sysLogger.log(Level.SEVERE, String.format("Error scanning the input directory %s", rootInputDirectory), ex); } } synchronized (scanMonitor) { @@ -1151,7 +1152,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen manifest = parser.parse(filePath); break; } catch (ManifestFileParserException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to parse %s with parser %s", filePath, parser.getClass().getCanonicalName()), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to parse %s with parser %s", filePath, parser.getClass().getCanonicalName()), ex); } } if (Thread.currentThread().isInterrupted()) { @@ -1205,21 +1206,21 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ break; default: - SYS_LOGGER.log(Level.SEVERE, "Unknown ManifestNodeData.ProcessingStatus"); + sysLogger.log(Level.SEVERE, "Unknown ManifestNodeData.ProcessingStatus"); break; } } catch (AutoIngestJobNodeData.InvalidDataException | AutoIngestJobException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Invalid auto ingest job node data for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Invalid auto ingest job node data for %s", manifestPath), ex); } } else { try { addNewPendingJob(manifest); } catch (AutoIngestJobException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Invalid manifest data for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Invalid manifest data for %s", manifestPath), ex); } } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error transmitting node data for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error transmitting node data for %s", manifestPath), ex); return CONTINUE; } catch (InterruptedException ex) { Thread.currentThread().interrupt(); @@ -1231,7 +1232,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen // Catch all unhandled and unexpected exceptions. Otherwise one bad file // can stop the entire input folder scanning. Given that the exception is unexpected, // I'm hesitant to add logging which requires accessing or de-referencing data. - SYS_LOGGER.log(Level.SEVERE, "Unexpected exception in file visitor", ex); + sysLogger.log(Level.SEVERE, "Unexpected exception in file visitor", ex); return CONTINUE; } @@ -1288,7 +1289,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen updateCoordinationServiceManifestNode(job); } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); } } Path caseDirectory = PathUtils.findCaseDirectory(rootOutputDirectory, manifest.getCaseName()); @@ -1330,7 +1331,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen newPendingJobsList.add(job); } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); } } @@ -1361,7 +1362,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen String manifestPath = manifest.getFilePath().toString(); try (Lock manifestLock = coordinationService.tryGetExclusiveLock(CoordinationService.CategoryNode.MANIFESTS, manifestPath)) { if (null != manifestLock) { - SYS_LOGGER.log(Level.SEVERE, "Attempting crash recovery for {0}", manifestPath); + sysLogger.log(Level.SEVERE, "Attempting crash recovery for {0}", manifestPath); try { Path caseDirectoryPath = PathUtils.findCaseDirectory(rootOutputDirectory, manifest.getCaseName()); @@ -1386,7 +1387,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { setCaseNodeDataErrorsOccurred(caseDirectoryPath); } catch (CaseNodeData.InvalidDataException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to get case node data for %s", caseDirectoryPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to get case node data for %s", caseDirectoryPath), ex); } } else { job.setErrorsOccurred(false); @@ -1398,7 +1399,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { new AutoIngestJobLogger(manifest.getFilePath(), manifest.getDataSourceFileName(), caseDirectoryPath).logCrashRecoveryWithRetry(); } catch (AutoIngestJobLoggerException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error creating case auto ingest log entry for crashed job for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error creating case auto ingest log entry for crashed job for %s", manifestPath), ex); } } } else { @@ -1407,7 +1408,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { new AutoIngestJobLogger(manifest.getFilePath(), manifest.getDataSourceFileName(), caseDirectoryPath).logCrashRecoveryNoRetry(); } catch (AutoIngestJobLoggerException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error creating case auto ingest log entry for crashed job for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error creating case auto ingest log entry for crashed job for %s", manifestPath), ex); } } } @@ -1419,7 +1420,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { updateCoordinationServiceManifestNode(job); } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifestPath), ex); return; } @@ -1435,12 +1436,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { manifestLock.release(); } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to release exclusive lock for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to release exclusive lock for %s", manifestPath), ex); } } } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to get exclusive lock for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to get exclusive lock for %s", manifestPath), ex); } } @@ -1495,13 +1496,13 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen updateCoordinationServiceManifestNode(job); } } catch (CoordinationServiceException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); + sysLogger.log(Level.SEVERE, String.format("Error attempting to set node data for %s", manifest.getFilePath()), ex); } } newCompletedJobsList.add(job); } else { - SYS_LOGGER.log(Level.WARNING, String.format("Job completed for %s, but cannot find case directory, ignoring job", nodeData.getManifestFilePath())); + sysLogger.log(Level.WARNING, String.format("Job completed for %s, but cannot find case directory, ignoring job", nodeData.getManifestFilePath())); } } @@ -1522,7 +1523,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ @Override public FileVisitResult visitFileFailed(Path file, IOException ex) throws IOException { - SYS_LOGGER.log(Level.SEVERE, String.format("Error while visiting %s during input directories scan", file.toString()), ex); + sysLogger.log(Level.SEVERE, String.format("Error while visiting %s during input directories scan", file.toString()), ex); if (Thread.currentThread().isInterrupted()) { return TERMINATE; } @@ -1607,7 +1608,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ @Override public void run() { - SYS_LOGGER.log(Level.INFO, "Job processing task started"); + sysLogger.log(Level.INFO, "Job processing task started"); while (true) { try { if (jobProcessingTaskFuture.isCancelled()) { @@ -1650,14 +1651,14 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } else { errorState = ErrorState.UNEXPECTED_EXCEPTION; } - SYS_LOGGER.log(Level.SEVERE, "Auto ingest system error", ex); + sysLogger.log(Level.SEVERE, "Auto ingest system error", ex); pauseForSystemError(); } } catch (InterruptedException ex) { break; } } - SYS_LOGGER.log(Level.INFO, "Job processing task stopped"); + sysLogger.log(Level.INFO, "Job processing task stopped"); } /** @@ -1666,7 +1667,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ private void requestPause() { synchronized (pauseLock) { - SYS_LOGGER.log(Level.INFO, "Job processing pause requested"); + sysLogger.log(Level.INFO, "Job processing pause requested"); pauseRequested = true; if (waitingForInputScan) { /* @@ -1689,7 +1690,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ private void requestResume() { synchronized (pauseLock) { - SYS_LOGGER.log(Level.INFO, "Job processing resume requested"); + sysLogger.log(Level.INFO, "Job processing resume requested"); pauseRequested = false; if (waitingForInputScan) { /* @@ -1719,12 +1720,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private void pauseIfRequested() throws InterruptedException { synchronized (pauseLock) { if (pauseRequested) { - SYS_LOGGER.log(Level.INFO, "Job processing paused by request"); + sysLogger.log(Level.INFO, "Job processing paused by request"); pauseRequested = false; setChanged(); notifyObservers(Event.PAUSED_BY_REQUEST); pauseLock.wait(); - SYS_LOGGER.log(Level.INFO, "Job processing resumed after pause request"); + sysLogger.log(Level.INFO, "Job processing resumed after pause request"); setChanged(); notifyObservers(Event.RESUMED); } @@ -1740,12 +1741,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ private void pauseForSystemError() throws InterruptedException { synchronized (pauseLock) { - SYS_LOGGER.log(Level.SEVERE, "Job processing paused for system error"); + sysLogger.log(Level.SEVERE, "Job processing paused for system error"); setChanged(); notifyObservers(Event.PAUSED_FOR_SYSTEM_ERROR); pauseLock.wait(); errorState = ErrorState.NONE; - SYS_LOGGER.log(Level.INFO, "Job processing resumed after system error"); + sysLogger.log(Level.INFO, "Job processing resumed after system error"); setChanged(); notifyObservers(Event.RESUMED); } @@ -1775,11 +1776,11 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ waitingForInputScan = true; } - SYS_LOGGER.log(Level.INFO, "Job processing waiting for input scan completion"); + sysLogger.log(Level.INFO, "Job processing waiting for input scan completion"); synchronized (scanMonitor) { scanMonitor.wait(); } - SYS_LOGGER.log(Level.INFO, "Job processing finished wait for input scan completion"); + sysLogger.log(Level.INFO, "Job processing finished wait for input scan completion"); synchronized (pauseLock) { waitingForInputScan = false; pauseIfRequested(); @@ -1845,7 +1846,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * job. */ private void processJobs() throws CoordinationServiceException, SharedConfigurationException, ServicesMonitorException, DatabaseServerDownException, KeywordSearchServerDownException, CaseManagementException, AnalysisStartupException, FileExportException, AutoIngestJobLoggerException, InterruptedException, AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException, AutoIngestJobNodeData.InvalidDataException, CaseNodeData.InvalidDataException, JobMetricsCollectionException { - SYS_LOGGER.log(Level.INFO, "Started processing pending jobs queue"); + sysLogger.log(Level.INFO, "Started processing pending jobs queue"); Lock manifestLock = JobProcessingTask.this.dequeueAndLockNextJob(); while (null != manifestLock) { try { @@ -1895,20 +1896,20 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * while reading the lock data */ private Lock dequeueAndLockNextJob() throws CoordinationServiceException, InterruptedException { - SYS_LOGGER.log(Level.INFO, "Checking pending jobs queue for ready job, enforcing max jobs per case"); + sysLogger.log(Level.INFO, "Checking pending jobs queue for ready job, enforcing max jobs per case"); Lock manifestLock; synchronized (jobsLock) { manifestLock = dequeueAndLockNextJob(true); if (null != manifestLock) { - SYS_LOGGER.log(Level.INFO, "Dequeued job for {0}", currentJob.getManifest().getFilePath()); + sysLogger.log(Level.INFO, "Dequeued job for {0}", currentJob.getManifest().getFilePath()); } else { - SYS_LOGGER.log(Level.INFO, "No ready job"); - SYS_LOGGER.log(Level.INFO, "Checking pending jobs queue for ready job, not enforcing max jobs per case"); + sysLogger.log(Level.INFO, "No ready job"); + sysLogger.log(Level.INFO, "Checking pending jobs queue for ready job, not enforcing max jobs per case"); manifestLock = dequeueAndLockNextJob(false); if (null != manifestLock) { - SYS_LOGGER.log(Level.INFO, "Dequeued job for {0}", currentJob.getManifest().getFilePath()); + sysLogger.log(Level.INFO, "Dequeued job for {0}", currentJob.getManifest().getFilePath()); } else { - SYS_LOGGER.log(Level.INFO, "No ready job"); + sysLogger.log(Level.INFO, "No ready job"); } } } @@ -1980,7 +1981,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen currentJob = job; break; } catch (AutoIngestJobNodeData.InvalidDataException ex) { - SYS_LOGGER.log(Level.WARNING, String.format("Unable to use node data for %s", manifestPath), ex); // JCTODO: Is this right? + sysLogger.log(Level.WARNING, String.format("Unable to use node data for %s", manifestPath), ex); // JCTODO: Is this right? } } } @@ -2047,7 +2048,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ private void processJob() throws CoordinationServiceException, SharedConfigurationException, ServicesMonitorException, DatabaseServerDownException, KeywordSearchServerDownException, CaseManagementException, AnalysisStartupException, FileExportException, AutoIngestJobLoggerException, InterruptedException, AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException, CaseNodeData.InvalidDataException, JobMetricsCollectionException { Path manifestPath = currentJob.getManifest().getFilePath(); - SYS_LOGGER.log(Level.INFO, "Started processing of {0}", manifestPath); + sysLogger.log(Level.INFO, "Started processing of {0}", manifestPath); currentJob.setProcessingStatus(AutoIngestJob.ProcessingStatus.PROCESSING); currentJob.setProcessingStage(AutoIngestJob.Stage.STARTING, Date.from(Instant.now())); currentJob.setProcessingHostName(AutoIngestManager.LOCAL_HOST_NAME); @@ -2078,7 +2079,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen updateCoordinationServiceManifestNode(currentJob); boolean retry = (!currentJob.isCanceled() && !currentJob.isCompleted()); - SYS_LOGGER.log(Level.INFO, "Completed processing of {0}, retry = {1}", new Object[]{manifestPath, retry}); + sysLogger.log(Level.INFO, "Completed processing of {0}, retry = {1}", new Object[]{manifestPath, retry}); if (currentJob.isCanceled()) { Path caseDirectoryPath = currentJob.getCaseDirectoryPath(); if (null != caseDirectoryPath) { @@ -2173,7 +2174,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private void updateConfiguration() throws SharedConfigurationException, InterruptedException { if (AutoIngestUserPreferences.getSharedConfigEnabled()) { Path manifestPath = currentJob.getManifest().getFilePath(); - SYS_LOGGER.log(Level.INFO, "Downloading shared configuration for {0}", manifestPath); + sysLogger.log(Level.INFO, "Downloading shared configuration for {0}", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.UPDATING_SHARED_CONFIG, Date.from(Instant.now())); new SharedConfiguration().downloadConfiguration(); } @@ -2191,7 +2192,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen */ private void verifyRequiredSevicesAreRunning() throws ServicesMonitorException, DatabaseServerDownException, KeywordSearchServerDownException { Path manifestPath = currentJob.getManifest().getFilePath(); - SYS_LOGGER.log(Level.INFO, "Checking services availability for {0}", manifestPath); + sysLogger.log(Level.INFO, "Checking services availability for {0}", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.CHECKING_SERVICES, Date.from(Instant.now())); if (!isServiceUp(ServicesMonitor.Service.REMOTE_CASE_DATABASE.toString())) { throw new DatabaseServerDownException("Case database server is down"); @@ -2238,7 +2239,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private Case openCase() throws CoordinationServiceException, CaseManagementException, InterruptedException { Manifest manifest = currentJob.getManifest(); String caseName = manifest.getCaseName(); - SYS_LOGGER.log(Level.INFO, "Opening case {0} for {1}", new Object[]{caseName, manifest.getFilePath()}); + sysLogger.log(Level.INFO, "Opening case {0} for {1}", new Object[]{caseName, manifest.getFilePath()}); currentJob.setProcessingStage(AutoIngestJob.Stage.OPENING_CASE, Date.from(Instant.now())); /* * Acquire and hold a case name lock so that only one node at as @@ -2272,7 +2273,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } currentJob.setCaseDirectoryPath(caseDirectoryPath); Case caseForJob = Case.getOpenCase(); - SYS_LOGGER.log(Level.INFO, "Opened case {0} for {1}", new Object[]{caseForJob.getName(), manifest.getFilePath()}); + sysLogger.log(Level.INFO, "Opened case {0} for {1}", new Object[]{caseForJob.getName(), manifest.getFilePath()}); return caseForJob; } catch (KeywordSearchModuleException ex) { @@ -2417,14 +2418,14 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private AutoIngestDataSource identifyDataSource() throws AutoIngestJobLoggerException, InterruptedException, CaseNodeData.InvalidDataException, CoordinationServiceException { Manifest manifest = currentJob.getManifest(); Path manifestPath = manifest.getFilePath(); - SYS_LOGGER.log(Level.INFO, "Identifying data source for {0} ", manifestPath); + sysLogger.log(Level.INFO, "Identifying data source for {0} ", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.IDENTIFYING_DATA_SOURCE, Date.from(Instant.now())); Path caseDirectoryPath = currentJob.getCaseDirectoryPath(); AutoIngestJobLogger jobLogger = new AutoIngestJobLogger(manifestPath, manifest.getDataSourceFileName(), caseDirectoryPath); Path dataSourcePath = manifest.getDataSourcePath(); File dataSource = dataSourcePath.toFile(); if (!dataSource.exists()) { - SYS_LOGGER.log(Level.SEVERE, "Missing data source for {0}", manifestPath); + sysLogger.log(Level.SEVERE, "Missing data source for {0}", manifestPath); currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); jobLogger.logMissingDataSource(); @@ -2451,7 +2452,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private void runDataSourceProcessor(Case caseForJob, AutoIngestDataSource dataSource) throws InterruptedException, AutoIngestJobLoggerException, AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException, CaseNodeData.InvalidDataException, CoordinationServiceException { Manifest manifest = currentJob.getManifest(); Path manifestPath = manifest.getFilePath(); - SYS_LOGGER.log(Level.INFO, "Adding data source for {0} ", manifestPath); + sysLogger.log(Level.INFO, "Adding data source for {0} ", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.ADDING_DATA_SOURCE, Date.from(Instant.now())); DataSourceProcessorProgressMonitor progressMonitor = new DoNothingDSPProgressMonitor(); Path caseDirectoryPath = currentJob.getCaseDirectoryPath(); @@ -2463,7 +2464,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { validDataSourceProcessors = DataSourceProcessorUtility.getOrderedListOfDataSourceProcessors(dataSource.getPath()); } catch (AutoIngestDataSourceProcessor.AutoIngestDataSourceProcessorException ex) { - SYS_LOGGER.log(Level.SEVERE, "Exception while determining best data source processor for {0}", dataSource.getPath()); + sysLogger.log(Level.SEVERE, "Exception while determining best data source processor for {0}", dataSource.getPath()); // rethrow the exception. It will get caught & handled upstream and will result in AIM auto-pause. throw ex; } @@ -2474,7 +2475,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen setCaseNodeDataErrorsOccurred(caseDirectoryPath); currentJob.setErrorsOccurred(true); jobLogger.logFailedToIdentifyDataSource(); - SYS_LOGGER.log(Level.WARNING, "Unsupported data source {0} for {1}", new Object[]{dataSource.getPath(), manifestPath}); // NON-NLS + sysLogger.log(Level.WARNING, "Unsupported data source {0} for {1}", new Object[]{dataSource.getPath(), manifestPath}); // NON-NLS return; } @@ -2486,7 +2487,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen DataSourceProcessorCallback callBack = new AddDataSourceCallback(caseForJob, dataSource, taskId, ingestLock); caseForJob.notifyAddingDataSource(taskId); jobLogger.logDataSourceProcessorSelected(selectedProcessor.getDataSourceType()); - SYS_LOGGER.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{manifestPath, selectedProcessor.getDataSourceType()}); + sysLogger.log(Level.INFO, "Identified data source type for {0} as {1}", new Object[]{manifestPath, selectedProcessor.getDataSourceType()}); selectedProcessor.process(dataSource.getDeviceId(), dataSource.getPath(), progressMonitor, callBack); ingestLock.wait(); @@ -2504,7 +2505,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen return; } // If we get to this point, none of the processors were successful - SYS_LOGGER.log(Level.SEVERE, "All data source processors failed to process {0}", dataSource.getPath()); + sysLogger.log(Level.SEVERE, "All data source processors failed to process {0}", dataSource.getPath()); jobLogger.logFailedToAddDataSource(); setCaseNodeDataErrorsOccurred(caseDirectoryPath); currentJob.setErrorsOccurred(true); @@ -2547,7 +2548,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen case NONCRITICAL_ERRORS: for (String errorMessage : dataSource.getDataSourceProcessorErrorMessages()) { - SYS_LOGGER.log(Level.WARNING, "Non-critical error running data source processor for {0}: {1}", new Object[]{manifestPath, errorMessage}); + sysLogger.log(Level.WARNING, "Non-critical error running data source processor for {0}: {1}", new Object[]{manifestPath, errorMessage}); } jobLogger.logDataSourceAdded(); if (dataSource.getContent().isEmpty()) { @@ -2557,7 +2558,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen case CRITICAL_ERRORS: for (String errorMessage : dataSource.getDataSourceProcessorErrorMessages()) { - SYS_LOGGER.log(Level.SEVERE, "Critical error running data source processor for {0}: {1}", new Object[]{manifestPath, errorMessage}); + sysLogger.log(Level.SEVERE, "Critical error running data source processor for {0}: {1}", new Object[]{manifestPath, errorMessage}); } jobLogger.logFailedToAddDataSource(); break; @@ -2570,7 +2571,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * AutoIngestJob and calling cancel on the DSP, if not null, in * cancelCurrentJob. */ - SYS_LOGGER.log(Level.WARNING, "Cancellation while waiting for data source processor for {0}", manifestPath); + sysLogger.log(Level.WARNING, "Cancellation while waiting for data source processor for {0}", manifestPath); jobLogger.logDataSourceProcessorCancelled(); } } @@ -2595,7 +2596,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private void analyze(AutoIngestDataSource dataSource) throws AnalysisStartupException, AutoIngestJobLoggerException, InterruptedException, CaseNodeData.InvalidDataException, CoordinationServiceException { Manifest manifest = currentJob.getManifest(); Path manifestPath = manifest.getFilePath(); - SYS_LOGGER.log(Level.INFO, "Starting ingest modules analysis for {0} ", manifestPath); + sysLogger.log(Level.INFO, "Starting ingest modules analysis for {0} ", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.ANALYZING_DATA_SOURCE, Date.from(Instant.now())); Path caseDirectoryPath = currentJob.getCaseDirectoryPath(); AutoIngestJobLogger jobLogger = new AutoIngestJobLogger(manifestPath, manifest.getDataSourceFileName(), caseDirectoryPath); @@ -2616,17 +2617,17 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen * is shutting down. */ ingestLock.wait(); - SYS_LOGGER.log(Level.INFO, "Finished ingest modules analysis for {0} ", manifestPath); + sysLogger.log(Level.INFO, "Finished ingest modules analysis for {0} ", manifestPath); IngestJob.ProgressSnapshot jobSnapshot = ingestJob.getSnapshot(); for (IngestJob.ProgressSnapshot.DataSourceProcessingSnapshot snapshot : jobSnapshot.getDataSourceSnapshots()) { if (!snapshot.isCancelled()) { List cancelledModules = snapshot.getCancelledDataSourceIngestModules(); if (!cancelledModules.isEmpty()) { - SYS_LOGGER.log(Level.WARNING, String.format("Ingest module(s) cancelled for %s", manifestPath)); + sysLogger.log(Level.WARNING, String.format("Ingest module(s) cancelled for %s", manifestPath)); currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); for (String module : snapshot.getCancelledDataSourceIngestModules()) { - SYS_LOGGER.log(Level.WARNING, String.format("%s ingest module cancelled for %s", module, manifestPath)); + sysLogger.log(Level.WARNING, String.format("%s ingest module cancelled for %s", module, manifestPath)); jobLogger.logIngestModuleCancelled(module); } } @@ -2644,14 +2645,14 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } } else if (!ingestJobStartResult.getModuleErrors().isEmpty()) { for (IngestModuleError error : ingestJobStartResult.getModuleErrors()) { - SYS_LOGGER.log(Level.SEVERE, String.format("%s ingest module startup error for %s", error.getModuleDisplayName(), manifestPath), error.getThrowable()); + sysLogger.log(Level.SEVERE, String.format("%s ingest module startup error for %s", error.getModuleDisplayName(), manifestPath), error.getThrowable()); } currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); jobLogger.logIngestModuleStartupErrors(); throw new AnalysisStartupException(String.format("Error(s) during ingest module startup for %s", manifestPath)); } else { - SYS_LOGGER.log(Level.SEVERE, String.format("Ingest manager ingest job start error for %s", manifestPath), ingestJobStartResult.getStartupException()); + sysLogger.log(Level.SEVERE, String.format("Ingest manager ingest job start error for %s", manifestPath), ingestJobStartResult.getStartupException()); currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); jobLogger.logAnalysisStartupError(); @@ -2659,7 +2660,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } } else { for (String warning : settingsWarnings) { - SYS_LOGGER.log(Level.SEVERE, "Ingest job settings error for {0}: {1}", new Object[]{manifestPath, warning}); + sysLogger.log(Level.SEVERE, "Ingest job settings error for {0}: {1}", new Object[]{manifestPath, warning}); } currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); @@ -2732,7 +2733,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private void exportFiles(AutoIngestDataSource dataSource) throws FileExportException, AutoIngestJobLoggerException, InterruptedException, CaseNodeData.InvalidDataException, CoordinationServiceException { Manifest manifest = currentJob.getManifest(); Path manifestPath = manifest.getFilePath(); - SYS_LOGGER.log(Level.INFO, "Exporting files for {0}", manifestPath); + sysLogger.log(Level.INFO, "Exporting files for {0}", manifestPath); currentJob.setProcessingStage(AutoIngestJob.Stage.EXPORTING_FILES, Date.from(Instant.now())); Path caseDirectoryPath = currentJob.getCaseDirectoryPath(); AutoIngestJobLogger jobLogger = new AutoIngestJobLogger(manifestPath, manifest.getDataSourceFileName(), caseDirectoryPath); @@ -2743,7 +2744,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen jobLogger.logFileExportCompleted(); } } catch (FileExportException ex) { - SYS_LOGGER.log(Level.SEVERE, String.format("Error doing file export for %s", manifestPath), ex); + sysLogger.log(Level.SEVERE, String.format("Error doing file export for %s", manifestPath), ex); currentJob.setErrorsOccurred(true); setCaseNodeDataErrorsOccurred(caseDirectoryPath); jobLogger.logFileExportError(); @@ -2916,7 +2917,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen private final long MAX_SECONDS_WITHOUT_UPDATE = JOB_STATUS_EVENT_INTERVAL_SECONDS * MAX_MISSED_JOB_STATUS_UPDATES; private PeriodicJobStatusEventTask() { - SYS_LOGGER.log(Level.INFO, "Periodic status publishing task started"); + sysLogger.log(Level.INFO, "Periodic status publishing task started"); } @Override @@ -2949,7 +2950,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen try { StatusDatabaseLogger.logToStatusDatabase(message, isError); } catch (SQLException | UserPreferencesException ex) { - SYS_LOGGER.log(Level.WARNING, "Failed to update status database", ex); + sysLogger.log(Level.WARNING, "Failed to update status database", ex); } } } @@ -2975,7 +2976,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen } } catch (Exception ex) { - SYS_LOGGER.log(Level.SEVERE, "Unexpected exception in PeriodicJobStatusEventTask", ex); //NON-NLS + sysLogger.log(Level.SEVERE, "Unexpected exception in PeriodicJobStatusEventTask", ex); //NON-NLS } } diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestSystemLogger.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestSystemLogger.java index 184d5d350a..33c3c20c23 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestSystemLogger.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/AutoIngestSystemLogger.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2015 Basis Technology Corp. + * Copyright 2015-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,8 +25,8 @@ import java.sql.Timestamp; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.LogRecord; -import java.util.logging.Logger; import javax.annotation.concurrent.GuardedBy; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.PlatformUtil; /** @@ -37,7 +37,7 @@ final class AutoIngestSystemLogger { private static final int LOG_SIZE = 50000000; // In bytes, zero is unlimited, set to roughly 10mb currently private static final int LOG_FILE_COUNT = 10; - private static final Logger LOGGER = Logger.getLogger("AutoIngest"); //NON-NLS + private static final Logger logger = Logger.getLogger("AutoIngest"); //NON-NLS private static final String NEWLINE = System.lineSeparator(); @GuardedBy("AutoIngestSystemLogger") private static boolean configured; @@ -74,14 +74,14 @@ final class AutoIngestSystemLogger { + stackTrace; } }); - LOGGER.addHandler(fileHandler); - LOGGER.setUseParentHandlers(false); + logger.addHandler(fileHandler); + logger.setUseParentHandlers(false); } catch (SecurityException | IOException ex) { throw new RuntimeException(String.format("Error initializing file handler for %s", logFilePath), ex); //NON-NLS } configured = true; } - return LOGGER; + return logger; } /** diff --git a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/StatusDatabaseLogger.java b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/StatusDatabaseLogger.java index 2fa6db1457..f8921e112d 100644 --- a/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/StatusDatabaseLogger.java +++ b/Experimental/src/org/sleuthkit/autopsy/experimental/autoingest/StatusDatabaseLogger.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2015 Basis Technology Corp. + * Copyright 2015-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,7 @@ import java.sql.Statement; import java.util.logging.Level; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferencesException; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.NetworkUtils; import org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreferences; @@ -33,72 +34,79 @@ import org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreference * Write auto-ingest status updates to a database. */ public class StatusDatabaseLogger { + /** - * Log the current status to the database using the database - * parameters saved in AutoIngestUserPreferences. - * @param message Current status message - * @param isError true if we're in an error state, false otherwise - * @throws SQLException + * Log the current status to the database using the database parameters + * saved in AutoIngestUserPreferences. + * + * @param message Current status message + * @param isError true if we're in an error state, false otherwise + * + * @throws SQLException If a SQL data access error occurs. + * @throws UserPreferencesException If there's an issue reading the user + * preferences. */ - public static void logToStatusDatabase(String message, boolean isError) throws SQLException, UserPreferencesException{ - - try{ + public static void logToStatusDatabase(String message, boolean isError) throws SQLException, UserPreferencesException { + + try { Class.forName("org.postgresql.Driver"); - } catch (ClassNotFoundException ex){ - java.util.logging.Logger SYS_LOGGER = AutoIngestSystemLogger.getLogger(); - SYS_LOGGER.log(Level.WARNING, "Error loading postgresql driver", ex); + } catch (ClassNotFoundException ex) { + Logger sysLogger = AutoIngestSystemLogger.getLogger(); + sysLogger.log(Level.WARNING, "Error loading postgresql driver", ex); } - try (Connection connection = DriverManager.getConnection("jdbc:postgresql://" + try (Connection connection = DriverManager.getConnection("jdbc:postgresql://" + AutoIngestUserPreferences.getLoggingDatabaseHostnameOrIP() + ":" + AutoIngestUserPreferences.getLoggingPort() + "/" + AutoIngestUserPreferences.getLoggingDatabaseName(), - AutoIngestUserPreferences.getLoggingUsername(), + AutoIngestUserPreferences.getLoggingUsername(), AutoIngestUserPreferences.getLoggingPassword()); Statement statement = connection.createStatement();) { logToStatusDatabase(statement, message, isError); } } - + /** - * Log the current status to the database using an already - * configured Statement. + * Log the current status to the database using an already configured + * Statement. + * * @param statement SQL statement (must have already been created) * @param message Current status message * @param isError true if we're in an error state, false otherwise - * @throws SQLException + * + * @throws SQLException */ - public static void logToStatusDatabase(Statement statement, String message, boolean isError) throws SQLException{ - if((statement == null) || statement.isClosed()){ + public static void logToStatusDatabase(Statement statement, String message, boolean isError) throws SQLException { + if ((statement == null) || statement.isClosed()) { throw new SQLException("SQL Statement is null/closed"); } - + int status; - if(isError){ + if (isError) { status = 1; } else { status = 0; } - String timestamp = new java.text.SimpleDate‌​Format("yyyy-MM-dd HH:mm:ss").format(ne‌​w java.util.Date()); + String timestamp = new java.text.SimpleDate‌​Format("yyyy-MM-dd HH:mm:ss").format( ne‌​w java.util.Date()); - String checkForPreviousEntry = "SELECT * FROM statusUpdates WHERE tool='" + UserPreferences.getAppName() + "' AND " + - "node='" + NetworkUtils.getLocalHostName() + "'"; + String checkForPreviousEntry = "SELECT * FROM statusUpdates WHERE tool='" + UserPreferences.getAppName() + "' AND " + + "node='" + NetworkUtils.getLocalHostName() + "'"; ResultSet resultSet = statement.executeQuery(checkForPreviousEntry); String logMessage; - if(resultSet.next()){ - logMessage = "UPDATE statusUpdates SET reportTime='" + timestamp + - "', message='" + message + "', status=" + status + if (resultSet.next()) { + logMessage = "UPDATE statusUpdates SET reportTime='" + timestamp + + "', message='" + message + "', status=" + status + " WHERE tool='" + UserPreferences.getAppName() + "' AND node='" + NetworkUtils.getLocalHostName() + "'"; } else { - logMessage = "INSERT INTO statusUpdates (tool, node, reportTime, message, status) " + - "VALUES ('" + UserPreferences.getAppName() - + "', '" + NetworkUtils.getLocalHostName() + - "', '" + - timestamp + "', '" + message + "', '" + status + "')"; + logMessage = "INSERT INTO statusUpdates (tool, node, reportTime, message, status) " + + "VALUES ('" + UserPreferences.getAppName() + + "', '" + NetworkUtils.getLocalHostName() + + "', '" + + timestamp + "', '" + message + "', '" + status + "')"; } - statement.execute(logMessage); + statement.execute(logMessage); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java index b09ad5430e..6cfba771b5 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,7 +39,7 @@ public class KeywordSearch { private static Server server; //we want a custom java.util.logging.Logger here for a reason //a separate logger from framework logs - private static final Logger TIKA_LOGGER = Logger.getLogger("Tika"); //NON-NLS + private static final Logger tikaLogger = Logger.getLogger("Tika"); //NON-NLS private static final org.sleuthkit.autopsy.coreutils.Logger logger = org.sleuthkit.autopsy.coreutils.Logger.getLogger(Case.class.getName()); // @@@ We should move this into TskData (or somewhere) because we are using @@ -70,9 +70,9 @@ public class KeywordSearch { 0, MAX_TIKA_LOG_FILES); tikaLogHandler.setFormatter(new SimpleFormatter()); tikaLogHandler.setEncoding(PlatformUtil.getLogFileEncoding()); - TIKA_LOGGER.addHandler(tikaLogHandler); + tikaLogger.addHandler(tikaLogHandler); //do not forward to the parent autopsy logger - TIKA_LOGGER.setUseParentHandlers(false); + tikaLogger.setUseParentHandlers(false); } catch (IOException | SecurityException ex) { logger.log(Level.SEVERE, "Error setting up tika logging", ex); //NON-NLS } @@ -84,7 +84,7 @@ public class KeywordSearch { } static Logger getTikaLogger() { - return TIKA_LOGGER; + return tikaLogger; } public static void addNumIndexedFilesChangeListener(PropertyChangeListener l) { diff --git a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java index d1860120a6..b1ff751b77 100644 --- a/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java +++ b/Testing/src/org/sleuthkit/autopsy/testing/AutopsyTestCases.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,6 @@ import java.util.Date; import java.util.List; import java.util.Random; import java.util.logging.Level; -import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.JDialog; import javax.swing.text.JTextComponent; @@ -58,6 +57,7 @@ import org.netbeans.jemmy.operators.JTreeOperator; import org.netbeans.jemmy.operators.JTreeOperator.NoSuchPathException; import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferencesException; +import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo; import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.CaseDbConnectionInfo; diff --git a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java index 0518da865b..87a24f5c85 100644 --- a/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java +++ b/Testing/test/qa-functional/src/org/sleuthkit/autopsy/testing/RegressionTest.java @@ -1,7 +1,7 @@ /* * Autopsy Forensic Browser * - * Copyright 2011-2017 Basis Technology Corp. + * Copyright 2011-2018 Basis Technology Corp. * Contact: carrier sleuthkit org * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,11 +20,11 @@ package org.sleuthkit.autopsy.testing; import java.io.File; import java.io.IOException; -import java.util.logging.Logger; import junit.framework.Test; import junit.framework.TestCase; import org.netbeans.jemmy.Timeouts; import org.netbeans.junit.NbModuleSuite; +import org.sleuthkit.autopsy.coreutils.Logger; /** * This test expects the following system properties to be set: img_path: The @@ -41,7 +41,7 @@ import org.netbeans.junit.NbModuleSuite; public class RegressionTest extends TestCase { private static final Logger logger = Logger.getLogger(RegressionTest.class.getName()); - private static AutopsyTestCases autopsyTests = new AutopsyTestCases(Boolean.parseBoolean(System.getProperty("isMultiUser"))); + private static final AutopsyTestCases autopsyTests = new AutopsyTestCases(Boolean.parseBoolean(System.getProperty("isMultiUser"))); /** * Constructor required by JUnit