IOhacker commented on code in PR #2389:
URL: https://github.com/apache/fineract/pull/2389#discussion_r910132134
##########
fineract-provider/src/main/resources/logback-spring.xml:
##########
@@ -32,7 +32,7 @@
<!-- See https://github.com/apache/fineract/#logging-guidelines for why by
default we log only to INFO, only (WARN and) ERROR
but it's still possible to override this using java
-Dlogging.level.root=info -jar fineract-provider.jar, as per
https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-custom-log-levels
-->
- <root level="info">
+ <root level="debug">
Review Comment:
yes, it is used only for my local dev
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/filters/CorrelationHeaderFilter.java:
##########
@@ -0,0 +1,78 @@
+/**
+ * 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.slf4j.MDC;
+
+import lombok.RequiredArgsConstructor;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.UUID;
+
+@RequiredArgsConstructor
+public class CorrelationHeaderFilter implements Filter {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(CorrelationHeaderFilter.class);
+
+
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+ //TODO
+ }
+
+ @Override
+ public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse, FilterChain filterChain)
+ throws IOException, ServletException {
+
+ LOGGER.info("CORRELATION_ID_HEADER : " +
RequestCorrelation.CORRELATION_ID_HEADER);
+
+ final HttpServletRequest httpServletRequest = (HttpServletRequest)
servletRequest;
+
+ String currentCorrId = httpServletRequest.getHeader(
RequestCorrelation.CORRELATION_ID_HEADER);
+
+ if (currentCorrId == null) {
+ currentCorrId = UUID.randomUUID().toString();
+ LOGGER.info("No correlationId found in Header. Generated : " +
currentCorrId);
+ } else {
+ LOGGER.info("Found correlationId in Header : " +
currentCorrId.replaceAll("[\r\n]","") );
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]