# HG changeset patch # User Severin Gehwolf # Date 1375439181 -7200 # Node ID ed17d02927c518ef9b2c53003ef7de4d05ff038b # Parent 1e59f46b6efa0f4642e225c512afff2479e4fd8f Add logging for exceptions in StorageCommand. Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-August/007753.html diff -r 1e59f46b6efa -r ed17d02927c5 agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java --- a/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java Thu Aug 01 14:07:37 2013 -0400 +++ b/agent/cli/src/main/java/com/redhat/thermostat/agent/cli/impl/db/StorageCommand.java Fri Aug 02 12:26:21 2013 +0200 @@ -38,6 +38,8 @@ import java.io.File; import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; import com.redhat.thermostat.agent.cli.impl.locale.LocaleResources; import com.redhat.thermostat.common.ExitStatus; @@ -47,12 +49,14 @@ import com.redhat.thermostat.common.cli.CommandException; import com.redhat.thermostat.common.tools.ApplicationException; import com.redhat.thermostat.common.tools.ApplicationState; +import com.redhat.thermostat.common.utils.LoggingUtils; import com.redhat.thermostat.shared.config.Configuration; import com.redhat.thermostat.shared.config.InvalidConfigurationException; import com.redhat.thermostat.shared.locale.Translate; public class StorageCommand extends AbstractStateNotifyingCommand { + private static final Logger logger = LoggingUtils.getLogger(StorageCommand.class); private static final Translate t = LocaleResources.createLocalizer(); private DBStartupConfiguration configuration; @@ -114,6 +118,7 @@ // rethrow throw e; } catch (Exception e) { + logger.log(Level.WARNING, e.getMessage(), e); getNotifier().fireAction(ApplicationState.FAIL, e); } }