Skip to content

Commit

Permalink
added logging for ifix-es-pipeline service
Browse files Browse the repository at this point in the history
  • Loading branch information
Taniya-eGov authored Jun 20, 2024
1 parent 5822df1 commit e87c33e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class FiscalDataEnrichmentService {
Map<String, HashMap<Integer, String>> tenantIdVshierarchyLevelVsLabelMap = new HashMap<>();

private HashMap<Integer, String> loadDepartmentHierarchyLevel(String tenantId){
log.info("Loading department hierarchy levels for tenantId: " + tenantId);
DepartmentHierarchyLevelSearchCriteria criteria = DepartmentHierarchyLevelSearchCriteria.builder().tenantId(tenantId).build();
DepartmentHierarchyLevelSearchRequest request = DepartmentHierarchyLevelSearchRequest.builder().criteria(criteria).requestHeader(new RequestHeader()).build();
Object result = serviceRequestRepository.fetchResult(getIfixDepartmentEntityUri(), request);
Expand All @@ -51,10 +52,13 @@ private HashMap<Integer, String> loadDepartmentHierarchyLevel(String tenantId){
if(!hierarchyLevelVsLabelMap.containsKey(hierarchyObject.getLevel()))
hierarchyLevelVsLabelMap.put(hierarchyObject.getLevel(), hierarchyObject.getLabel().replaceAll(" ", "_"));
});

log.info("Loaded department hierarchy levels: " + hierarchyLevelVsLabelMap);
return hierarchyLevelVsLabelMap;
}

public void enrichFiscalData(FiscalEvent fiscalEvent){
log.info("Enriching fiscal data for event: " + fiscalEvent);
HashMap<String, Object> attributes = (HashMap<String, Object>) fiscalEvent.getAttributes();

HashMap<String, Object> departmentEntity = new HashMap<>();
Expand Down Expand Up @@ -82,7 +86,7 @@ public void enrichFiscalData(FiscalEvent fiscalEvent){

fiscalEvent.setHierarchyMap(hierarchyMap);

log.info(fiscalEvent.toString());
log.info("Enriched fiscal event: " + fiscalEvent.toString());
}

private StringBuilder getIfixDepartmentEntityUri(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ server.servlet.context-path=/ifix
server.port=8283
app.timezone=UTC

logging.level.org.egov.ifixespipeline=DEBUG

# KAFKA SERVER CONFIGURATIONS
kafka.config.bootstrap_server_config=localhost:9092
spring.kafka.consumer.value-deserializer=org.egov.tracer.kafka.deserializer.HashMapDeserializer
Expand Down

0 comments on commit e87c33e

Please sign in to comment.