Skip to content

Commit

Permalink
Merge pull request #23 from project-sunbird/loging-verification
Browse files Browse the repository at this point in the history
Issues #SB-4319 fix: changes for loging
  • Loading branch information
bvinayakumar authored Jun 7, 2018
2 parents f7ce815 + 23027f5 commit 39defbb
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 48 deletions.
2 changes: 1 addition & 1 deletion service/app/controllers/audit/AuditLogController.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AuditLogController extends BaseController {
public Promise<Result> searchAuditHistory() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Request for search audith-istory.", requestData, LoggerEnum.DEBUG.name());
ProjectLogger.log("AuditLogController: searchAuditHistory called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.SEARCH_AUDIT_LOG.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

/**
* This controller will handle all the API related to course batches , add batch,update batch,join
* member to batch, remove member from batch, get particular batch details.
*
* @author Manzarul
*/
Expand All @@ -38,7 +37,8 @@ public Promise<Result> createBatch() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("create new batch request data=" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"CourseBatchController: createBatch called" + requestData, LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
RequestValidator.validateCreateBatchReq(reqObj);
reqObj.setOperation(ActorOperations.CREATE_BATCH.getValue());
Expand Down Expand Up @@ -204,7 +204,9 @@ private Map<String, String> getAllRequestHeaders(play.mvc.Http.Request request)
public Promise<Result> search() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Course batch search api call =" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"CourseBatchController: search called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.COMPOSITE_SEARCH.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class DbOperationController extends BaseController {
public Promise<Result> create() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting create data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: create called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.CREATE_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -41,7 +41,7 @@ public Promise<Result> create() {
public Promise<Result> update() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting update data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: update called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.UPDATE_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -61,7 +61,7 @@ public Promise<Result> update() {
public Promise<Result> delete() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting delete data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: delete called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.DELETE_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -81,7 +81,7 @@ public Promise<Result> delete() {
public Promise<Result> read() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting read data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: read called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.READ_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -101,7 +101,7 @@ public Promise<Result> read() {
public Promise<Result> readAll() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting read all data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: readAll called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.READ_ALL_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -121,7 +121,7 @@ public Promise<Result> readAll() {
public Promise<Result> search() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("getting search data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: search called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.SEARCH_DATA.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -141,7 +141,7 @@ public Promise<Result> search() {
public Promise<Result> getMetrics() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("get metrics data request = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("DbOperationController: getMetrics called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.GET_METRICS.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class GeoLocationController extends BaseController {
public Promise<Result> createGeoLocation() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("create geo location" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("create geo location" + requestData, LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.CREATE_GEO_LOCATION.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand Down Expand Up @@ -91,7 +91,7 @@ public Promise<Result> deleteGeoLocation(String locationId) {
public Promise<Result> sendNotification() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Send notification api call" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("createGeoLocation:sendNotification called", LoggerEnum.INFO.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
RequestValidator.validateSendNotification(reqObj);
reqObj.setOperation(ActorOperations.SEND_NOTIFICATION.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public Promise<Result> createOrg() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Create organisation request: " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: createOrg called" + requestData, LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateCreateOrg(reqObj);
Expand Down Expand Up @@ -76,7 +77,9 @@ public Promise<Result> approveOrg() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Approve organisation request: " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: approveOrg called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateOrg(reqObj);
Expand All @@ -103,7 +106,9 @@ public Promise<Result> updateOrg() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Update organisation request: " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: updateOrg called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUpdateOrg(reqObj);
Expand Down Expand Up @@ -135,7 +140,9 @@ public Promise<Result> updateOrgStatus() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Update organisation request: " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: updateOrgStatus called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUpdateOrgStatus(reqObj);
Expand All @@ -161,7 +168,9 @@ public Promise<Result> getOrgDetails() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Get Organisation details request: " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: getOrgDetails called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateOrg(reqObj);
Expand All @@ -187,7 +196,9 @@ public Promise<Result> addMemberToOrganisation() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(" add member to organisation = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: addMemberToOrganisation called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateAddMember(reqObj);
Expand All @@ -214,7 +225,7 @@ public Promise<Result> removeMemberFromOrganisation() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(
" remove member from organisation = " + requestData, LoggerEnum.INFO.name());
"OrganisationController: removeMemberFromOrganisation called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUserOrg(reqObj);
Expand All @@ -240,7 +251,8 @@ public Promise<Result> joinUserOrganisation() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(" join user organisation = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: joinUserOrganisation called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUserOrg(reqObj);
Expand All @@ -266,7 +278,8 @@ public Promise<Result> approveUserOrganisation() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(" approve user organisation = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: approveUserOrganisation called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUserOrg(reqObj);
Expand All @@ -292,7 +305,9 @@ public Promise<Result> rejectUserOrganisation() {

try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(" approve user organisation = " + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: rejectUserOrganisation called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
RequestValidator.validateUserOrg(reqObj);
Expand All @@ -317,7 +332,9 @@ public Promise<Result> rejectUserOrganisation() {
public Promise<Result> downloadOrgs() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(" Downlaod org data request =" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log(
"OrganisationController: downloadOrgs called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
reqObj.setOperation(ActorOperations.DOWNLOAD_ORGS.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -342,7 +359,7 @@ public Promise<Result> downloadOrgs() {
public Promise<Result> search() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log("Organisation search api call =" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("OrganisationController: search called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
ProjectUtil.updateMapSomeValueTOLowerCase(reqObj);
reqObj.setOperation(ActorOperations.COMPOSITE_SEARCH.getValue());
Expand Down Expand Up @@ -375,7 +392,7 @@ public Promise<Result> search() {
*/
public Promise<Result> getOrgTypeList() {
try {
ProjectLogger.log("Organisation getOrgTypeList method call", LoggerEnum.INFO.name());
ProjectLogger.log("OrganisationController: getOrgTypeList called", LoggerEnum.DEBUG.name());
Request reqObj = new Request();
reqObj.setOperation(ActorOperations.GET_ORG_TYPE_LIST.getValue());
reqObj.setRequestId(ExecutionContext.getRequestId());
Expand All @@ -395,8 +412,7 @@ public Promise<Result> getOrgTypeList() {
public Promise<Result> createOrgType() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(
"Organisation CreateOrgType method call =" + requestData, LoggerEnum.INFO.name());
ProjectLogger.log("OrganisationController: createOrgType called", LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
RequestValidator.validateCreateOrgType(reqObj);
reqObj.setOperation(ActorOperations.CREATE_ORG_TYPE.getValue());
Expand All @@ -418,7 +434,8 @@ public Promise<Result> updateOrgType() {
try {
JsonNode requestData = request().body().asJson();
ProjectLogger.log(
"Organisation UpdateOrgType method call =" + requestData, LoggerEnum.INFO.name());
"OrganisationController: updateOrgType called with data = " + requestData,
LoggerEnum.DEBUG.name());
Request reqObj = (Request) mapper.RequestMapper.mapRequest(requestData, Request.class);
RequestValidator.validateUpdateOrgType(reqObj);
reqObj.setOperation(ActorOperations.UPDATE_ORG_TYPE.getValue());
Expand Down
Loading

0 comments on commit 39defbb

Please sign in to comment.