qserv logging

This commit is contained in:
Peter Hormanns 2017-09-19 20:23:23 +02:00
parent ced5cc9827
commit b05e5555f2
2 changed files with 9 additions and 0 deletions

View File

@ -6,12 +6,15 @@ import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.logging.Logger;
import de.hsadmin.core.util.Config; import de.hsadmin.core.util.Config;
public class JDBCProcessor extends AbstractProcessor { public class JDBCProcessor extends AbstractProcessor {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final Logger LOG = Logger.getLogger(JDBCProcessor.class.getName());
final private String driver; final private String driver;
final private String url; final private String url;
@ -28,6 +31,7 @@ public class JDBCProcessor extends AbstractProcessor {
this.password = password; this.password = password;
this.errorMsg = ""; this.errorMsg = "";
this.sql = new ArrayList<String>(); this.sql = new ArrayList<String>();
LOG.info("Constructor 1 - DB-User: " + user + " Password: " + password);
} }
public JDBCProcessor(final String driver, final String url) throws ProcessorException { public JDBCProcessor(final String driver, final String url) throws ProcessorException {
@ -45,6 +49,7 @@ public class JDBCProcessor extends AbstractProcessor {
throw new ProcessorException("database admin-user configuration failed"); throw new ProcessorException("database admin-user configuration failed");
} }
} }
LOG.info("Constructor 2 - DB-User: " + user + " Password: " + password);
this.errorMsg = ""; this.errorMsg = "";
this.sql = new ArrayList<String>(); this.sql = new ArrayList<String>();
} }

View File

@ -3,10 +3,13 @@ package de.hsadmin.core.util;
import java.io.File; import java.io.File;
import java.io.FileReader; import java.io.FileReader;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Logger;
public class Config { public class Config {
private static Config instance; private static Config instance;
private static Logger LOG = Logger.getLogger(Config.class.getName());
private Properties props; private Properties props;
@ -27,6 +30,7 @@ public class Config {
} }
if (file.canRead()) { if (file.canRead()) {
try { try {
LOG.info("Constructor - Properties-File: " + file.getAbsolutePath());
props.load(new FileReader(file)); props.load(new FileReader(file));
} catch (Exception e) { } catch (Exception e) {
// should not happen // should not happen