Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added logging for ifix-es-pipeline service #220

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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