java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
branchv_0
changeset 63 3b9ec9c23a37
parent 56 29f45ab3b959
child 64 fcc499518dc7
--- a/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Thu Dec 26 00:18:03 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Thu Dec 26 00:58:00 2013 +0100
@@ -29,6 +29,7 @@
 import java.io.IOException;
 import java.sql.SQLException;
 import java.util.logging.Level;
+import java.util.logging.LogRecord;
 import java.util.logging.Logger;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
@@ -49,7 +50,7 @@
 	public static void main(String[] args) {
 		log.log(Level.FINE, "Starting " + Constants.PROGRAM_NAME);
 		int exitCode = EXIT_EXPECTED_ERROR;
-		
+
 		if (args.length == 0) {
 			args = new String[]{CLIParser.Tokens.INFO_HELP};
 		}
@@ -68,7 +69,10 @@
 		} catch (InvalidOptionsException e) {
 			log.log(Level.SEVERE, "Invalid CLI options", e);
 			for (InvalidOptionsException.OptionProblem p : e.getProblems()) {
-				log.log(Level.SEVERE, "Option problem: {0}", p.getDescription());
+				LogRecord r = new LogRecord(Level.SEVERE, "Option problem: {0}");
+				r.setThrown(p.getException());
+				r.setParameters(new Object[]{p.getDescription()});
+				log.log(r);
 			}
 		} catch (ConfigurationException e) {
 			log.log(Level.SEVERE, "Configuration problem", e);