FINERACT-1724: Added extra logging for traceability
This commit is contained in:
committed by
Arnold Gálovics
parent
9b8a16a76b
commit
1220f2f4a9
+3
-1
@@ -103,8 +103,10 @@ public class BatchApiServiceImpl implements BatchApiService {
|
||||
final BatchRequest rootRequest = rootNode.getRequest();
|
||||
final CommandStrategy commandStrategy = this.strategyProvider
|
||||
.getCommandStrategy(CommandContext.resource(rootRequest.getRelativeUrl()).method(rootRequest.getMethod()).build());
|
||||
log.debug("Batch request: method [{}], relative url [{}]", rootRequest.getMethod(), rootRequest.getRelativeUrl());
|
||||
final BatchResponse rootResponse = safelyExecuteStrategy(commandStrategy, rootRequest, uriInfo);
|
||||
|
||||
log.debug("Batch response: status code [{}], method [{}], relative url [{}]", rootResponse.getStatusCode(),
|
||||
rootRequest.getMethod(), rootRequest.getRelativeUrl());
|
||||
responseList.add(rootResponse);
|
||||
responseList.addAll(this.processChildRequests(rootNode, rootResponse, uriInfo));
|
||||
}
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.fineract.infrastructure.core.filters;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.filter.OncePerRequestFilter;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RequestResponseFilter extends OncePerRequestFilter {
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||
throws ServletException, IOException {
|
||||
log.debug("Received request: [{}], [{}]", request.getMethod(), request.getRequestURI());
|
||||
filterChain.doFilter(request, response);
|
||||
log.debug("Sent response: [{}] for [{}], [{}]", response.getStatus(), request.getMethod(), request.getRequestURI());
|
||||
}
|
||||
}
|
||||
+2
@@ -135,6 +135,8 @@ public class SendAsynchronousEventsTasklet implements Tasklet {
|
||||
ByteBuffer toByteBuffer = message.toByteBuffer();
|
||||
byte[] convert = byteBufferConverter.convert(toByteBuffer);
|
||||
messages.add(convert);
|
||||
log.debug("Created message to send with id: [{}], type: [{}], idempotency key: [{}]", message.getId(), message.getType(),
|
||||
message.getIdempotencyKey());
|
||||
}
|
||||
return messages;
|
||||
} catch (IOException e) {
|
||||
|
||||
+4
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.fineract.avro.BulkMessageItemV1;
|
||||
import org.apache.fineract.avro.BulkMessagePayloadV1;
|
||||
import org.apache.fineract.infrastructure.event.business.domain.BulkBusinessEvent;
|
||||
@@ -41,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Transactional
|
||||
@Slf4j
|
||||
public class ExternalEventService {
|
||||
|
||||
private final ExternalEventRepository repository;
|
||||
@@ -65,6 +67,8 @@ public class ExternalEventService {
|
||||
externalEvent = handleRegularBusinessEvent(event);
|
||||
}
|
||||
repository.save(externalEvent);
|
||||
log.debug("Saved message with idempotency key: [{}] of type [{}] and category [{}]", externalEvent.getIdempotencyKey(),
|
||||
externalEvent.getType(), externalEvent.getCategory());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException("Error while serializing event " + event.getClass().getSimpleName(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user