TSK-1100 Replaced printStackTrace by error logging

This commit is contained in:
Sofie Hofmann 2020-02-10 10:28:23 +01:00
parent 1ecb613526
commit 91f17fb221
2 changed files with 4 additions and 6 deletions

View File

@ -27,7 +27,7 @@ public class DbSchemaCreator {
private StringWriter errorWriter = new StringWriter();
private PrintWriter errorLogWriter = new PrintWriter(errorWriter);
public DbSchemaCreator(DataSource dataSource, String schema) throws SQLException {
public DbSchemaCreator(DataSource dataSource, String schema) {
this.dataSource = dataSource;
this.schemaName = schema;
}
@ -69,8 +69,7 @@ public class DbSchemaCreator {
}
}
} catch (IOException e) {
e.printStackTrace();
LOGGER.error("SchemaName sql parsing failed for schemaName {}", schemaName);
LOGGER.error("SchemaName SQL parsing failed for schemaName {}", schemaName, e);
}
return new StringReader(content.toString());
}

View File

@ -32,7 +32,6 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
}
} catch (SQLException e) {
LOGGER.error("There was an error creating Taskana history engine", e);
e.printStackTrace();
}
this.historyEventMapper =
this.taskanaHistoryEngine.getSqlSession().getMapper(HistoryEventMapper.class);
@ -50,10 +49,10 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
}
historyEventMapper.insert(event);
} catch (SQLException e) {
e.printStackTrace();
LOGGER.error("Error while inserting history event into historyEventMapper", e);
} finally {
taskanaHistoryEngine.returnConnection();
LOGGER.debug("exit from create(TaskanaHistoryEvent event). Returning object = {}.", event);
LOGGER.debug("Exit from create(TaskanaHistoryEvent event). Returning object = {}.", event);
}
}