chore: Added logs to allow capturing request id and processing for he… (#36177)

This commit is contained in:
Nidhi 2024-09-09 10:35:47 +05:30 committed by GitHub
parent 58b07ddef6
commit 943cccc44e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -6,11 +6,13 @@ import com.appsmith.server.dtos.ResponseDTO;
import com.appsmith.server.services.HealthCheckService; import com.appsmith.server.services.HealthCheckService;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
@Slf4j
@RequestMapping(Url.HEALTH_CHECK) @RequestMapping(Url.HEALTH_CHECK)
@AllArgsConstructor @AllArgsConstructor
public class HealthCheckControllerCE { public class HealthCheckControllerCE {
@ -19,6 +21,7 @@ public class HealthCheckControllerCE {
@JsonView(Views.Public.class) @JsonView(Views.Public.class)
@GetMapping @GetMapping
public Mono<ResponseDTO<String>> getHealth() { public Mono<ResponseDTO<String>> getHealth() {
log.debug("Checking server health ...");
return healthCheckService.getHealth().map(health -> new ResponseDTO<>(HttpStatus.OK.value(), health, null)); return healthCheckService.getHealth().map(health -> new ResponseDTO<>(HttpStatus.OK.value(), health, null));
} }
} }

View File

@ -7,6 +7,7 @@ import com.appsmith.server.domains.TenantConfiguration;
import com.appsmith.server.dtos.ResponseDTO; import com.appsmith.server.dtos.ResponseDTO;
import com.appsmith.server.services.TenantService; import com.appsmith.server.services.TenantService;
import com.fasterxml.jackson.annotation.JsonView; import com.fasterxml.jackson.annotation.JsonView;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@ -16,6 +17,7 @@ import reactor.core.publisher.Mono;
import java.util.Map; import java.util.Map;
@Slf4j
@RequestMapping(Url.TENANT_URL) @RequestMapping(Url.TENANT_URL)
public class TenantControllerCE { public class TenantControllerCE {
@ -37,6 +39,7 @@ public class TenantControllerCE {
@JsonView(Views.Public.class) @JsonView(Views.Public.class)
@GetMapping("/current") @GetMapping("/current")
public Mono<ResponseDTO<Tenant>> getTenantConfig() { public Mono<ResponseDTO<Tenant>> getTenantConfig() {
log.debug("Attempting to retrieve tenant configuration ... ");
return service.getTenantConfiguration() return service.getTenantConfiguration()
.map(resource -> new ResponseDTO<>(HttpStatus.OK.value(), resource, null)); .map(resource -> new ResponseDTO<>(HttpStatus.OK.value(), resource, null));
} }