diff --git a/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/meta/schema/SchemaController.java b/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/meta/schema/SchemaController.java index a0d4a307..5af0ab5f 100644 --- a/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/meta/schema/SchemaController.java +++ b/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/meta/schema/SchemaController.java @@ -32,11 +32,11 @@ public class SchemaController implements SchemaRestApi { @Override public List getObjects(String dbId, String filter, Boolean columns) { - log.info("Filter - {}", filter); + log.debug("Filter - {}", filter); DbMeta dbMeta = jdbcManager.getDbMetaByDbId(dbId); - log.info("dbMeta - {}", dbMeta); + if (Objects.isNull(dbMeta)) { return List.of(); diff --git a/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/sql/SQLTemplateController.java b/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/sql/SQLTemplateController.java index ebeac65c..e4167882 100644 --- a/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/sql/SQLTemplateController.java +++ b/api-rest/src/main/java/com/homihq/db2rest/jdbc/rest/sql/SQLTemplateController.java @@ -40,7 +40,7 @@ public Object sqlTemplate(@PathVariable String dbId, ) { final Map context = createContext(userPathVariable, requestParams, requestHeaders, matrixVariables); - log.info("context - {}", context); + log.debug("context - {}", context); return sqlTemplateExecutorService.execute(dbId, fileName, context); diff --git a/auth/src/main/java/com/homihq/db2rest/auth/AuthFilter.java b/auth/src/main/java/com/homihq/db2rest/auth/AuthFilter.java index 4bc11134..f64d6f44 100644 --- a/auth/src/main/java/com/homihq/db2rest/auth/AuthFilter.java +++ b/auth/src/main/java/com/homihq/db2rest/auth/AuthFilter.java @@ -33,19 +33,19 @@ protected void doFilterInternal( final FilterChain filterChain ) throws ServletException, IOException { - log.info("Handling Auth"); + log.debug("Handling Auth"); String requestUri = urlPathHelper.getRequestUri(request); String method = request.getMethod(); - log.info("Request URI - {}", requestUri); + log.debug("Request URI - {}", requestUri); if (!authProvider.isExcluded(requestUri, method)) { //authenticate UserDetail userDetail = authProvider.authenticate(request); - log.info("user detail - {}", userDetail); + log.debug("user detail - {}", userDetail); if (Objects.isNull(userDetail)) { String errorMessage = "Authentication failure."; @@ -63,12 +63,12 @@ protected void doFilterInternal( return; } } else { - log.info("URI in whitelist. Security checks not applied."); + log.debug("URI in whitelist. Security checks not applied."); } filterChain.doFilter(request, response); - logger.info("Completed Auth Filter"); + logger.debug("Completed Auth Filter"); } private void addError( diff --git a/auth/src/main/java/com/homihq/db2rest/auth/common/AbstractAuthProvider.java b/auth/src/main/java/com/homihq/db2rest/auth/common/AbstractAuthProvider.java index 10bb9dd5..162ec3a9 100644 --- a/auth/src/main/java/com/homihq/db2rest/auth/common/AbstractAuthProvider.java +++ b/auth/src/main/java/com/homihq/db2rest/auth/common/AbstractAuthProvider.java @@ -79,13 +79,13 @@ protected boolean authorizeInternal( .stream() .anyMatch(role -> StringUtils.equalsAnyIgnoreCase(role, userDetail.getRoles())); - log.info("Role match result - {}", roleMatch); + log.debug("Role match result - {}", roleMatch); return roleMatch; } - log.info("Failed to match resource role and/or HTTP method"); + log.debug("Failed to match resource role and/or HTTP method"); return false; } diff --git a/auth/src/main/java/com/homihq/db2rest/auth/data/ApiAuthDataProvider.java b/auth/src/main/java/com/homihq/db2rest/auth/data/ApiAuthDataProvider.java index f025a233..49e95b05 100644 --- a/auth/src/main/java/com/homihq/db2rest/auth/data/ApiAuthDataProvider.java +++ b/auth/src/main/java/com/homihq/db2rest/auth/data/ApiAuthDataProvider.java @@ -31,7 +31,7 @@ public ApiAuthDataProvider(String apiEndPoint, String apiKey) { .retrieve() .body(AuthDataSource.class); - log.info("Auth data - {}", authDataSource); + log.debug("Auth data - {}", authDataSource); } @Override diff --git a/auth/src/main/java/com/homihq/db2rest/auth/data/FileAuthDataProvider.java b/auth/src/main/java/com/homihq/db2rest/auth/data/FileAuthDataProvider.java index 2090917e..87e0efb1 100644 --- a/auth/src/main/java/com/homihq/db2rest/auth/data/FileAuthDataProvider.java +++ b/auth/src/main/java/com/homihq/db2rest/auth/data/FileAuthDataProvider.java @@ -28,7 +28,7 @@ public FileAuthDataProvider(String authFileFullPath) { authDataSource = objectMapper.readValue(inputStream, AuthDataSource.class); - log.info("authDataSource - {}", authDataSource); + log.debug("authDataSource - {}", authDataSource); } catch (Exception e) { diff --git a/auth/src/main/java/com/homihq/db2rest/auth/unkey/UnKeyAuthFilter.java b/auth/src/main/java/com/homihq/db2rest/auth/unkey/UnKeyAuthFilter.java index da9cf84c..08554e61 100644 --- a/auth/src/main/java/com/homihq/db2rest/auth/unkey/UnKeyAuthFilter.java +++ b/auth/src/main/java/com/homihq/db2rest/auth/unkey/UnKeyAuthFilter.java @@ -29,7 +29,7 @@ public class UnKeyAuthFilter extends OncePerRequestFilter { @Override protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException { - logger.info(" *** Apply UnKeyAuth Filter ***"); + logger.debug(" *** Apply UnKeyAuth Filter ***"); // Check the header and return authentication failed if header not present @@ -43,7 +43,7 @@ protected void doFilterInternal(final HttpServletRequest request, final HttpServ if (verifyResponse.isPresent()) { //TODO convert and add to request attributes - log.info("Unkey response - {}", verifyResponse.get()); + log.debug("Unkey response - {}", verifyResponse.get()); if (!verifyResponse.get().isValidKey()) { addAuthenticationError(request, response); return; @@ -55,7 +55,7 @@ protected void doFilterInternal(final HttpServletRequest request, final HttpServ filterChain.doFilter(request, response); - logger.info("Completed UnKey Auth Filter"); + logger.debug("Completed UnKey Auth Filter"); } private void addAuthenticationError(HttpServletRequest request, HttpServletResponse response) throws IOException { diff --git a/dialects/pg-dialect/src/main/java/com/homihq/db2rest/jdbc/config/dialect/PostGreSQLDialect.java b/dialects/pg-dialect/src/main/java/com/homihq/db2rest/jdbc/config/dialect/PostGreSQLDialect.java index 35c45273..13ccc334 100644 --- a/dialects/pg-dialect/src/main/java/com/homihq/db2rest/jdbc/config/dialect/PostGreSQLDialect.java +++ b/dialects/pg-dialect/src/main/java/com/homihq/db2rest/jdbc/config/dialect/PostGreSQLDialect.java @@ -37,7 +37,7 @@ public void processTypes(DbTable table, List insertableColumns, Map insertableColumns, Map convertToInsertableColumnList( insertableColumnList.add(new InsertableColumn(colName, null)); } - log.info("Sequences - {}", sequences); + log.debug("Sequences - {}", sequences); if (Objects.nonNull(sequences)) { for (String sequence : sequences) { String[] colSeq = sequence.split(":"); diff --git a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcCreateService.java b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcCreateService.java index 2158ba37..ca583b7c 100644 --- a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcCreateService.java +++ b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcCreateService.java @@ -51,7 +51,7 @@ public CreateResponse save( List pkColumns = dbTable.buildPkColumns(); for (DbColumn pkColumn : pkColumns) { - log.info("Adding primary key columns - {}", pkColumn.name()); + log.debug("Adding primary key columns - {}", pkColumn.name()); insertableColumns.add(pkColumn.name()); } @@ -65,7 +65,7 @@ public CreateResponse save( insertableColumnList.add(new InsertableColumn(colName, null)); } - log.info("Sequences - {}", sequences); + log.debug("Sequences - {}", sequences); if (Objects.nonNull(sequences)) { //handle oracle sequence for (String sequence : sequences) { String[] colSeq = sequence.split(":"); @@ -81,8 +81,8 @@ public CreateResponse save( CreateContext context = new CreateContext(dbId, dbTable, insertableColumns, insertableColumnList); String sql = sqlCreatorTemplate.create(context); - log.info("SQL - {}", sql); - log.info("Data - {}", data); + log.debug("SQL - {}", sql); + log.debug("Data - {}", data); CreateResponse createResponse = diff --git a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcDeleteService.java b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcDeleteService.java index a29a8747..e642a2d1 100644 --- a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcDeleteService.java +++ b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcDeleteService.java @@ -47,8 +47,8 @@ private int executeDelete(String dbId, String filter, DbTable table, DeleteConte String sql = sqlCreatorTemplate.deleteQuery(context); - log.info("{}", sql); - log.info("{}", context.getParamMap()); + log.debug("{}", sql); + log.debug("{}", context.getParamMap()); Integer i = this.jdbcManager.getTxnTemplate(dbId).execute(status -> { try { diff --git a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcFunctionService.java b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcFunctionService.java index dda9da09..f5ddd9ab 100644 --- a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcFunctionService.java +++ b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcFunctionService.java @@ -16,14 +16,14 @@ public class JdbcFunctionService implements FunctionService { @Override public SimpleJdbcCall getSimpleJdbcCall(String dbId, String subRoutineName) { - log.info("dbId - {}", dbId); + JdbcTemplate jdbcTemplate = jdbcManager.getNamedParameterJdbcTemplate(dbId).getJdbcTemplate(); return new SimpleJdbcCall(jdbcTemplate).withFunctionName(subRoutineName); } @Override public Map execute(String dbId, String subRoutineName, Map inParams) { - log.info("dbId - {}", dbId); + JdbcTemplate jdbcTemplate = jdbcManager.getNamedParameterJdbcTemplate(dbId).getJdbcTemplate(); return doExecute(jdbcTemplate, dbId, subRoutineName, inParams); } diff --git a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcProcedureService.java b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcProcedureService.java index d5bc1004..ffba570d 100644 --- a/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcProcedureService.java +++ b/rdbms-support/src/main/java/com/homihq/db2rest/jdbc/core/service/JdbcProcedureService.java @@ -24,8 +24,8 @@ public Map execute(String dbId, String subRoutineName, Map