전체 글
-
[Spring Boot] Logging 과 @slf4j 에 대해서개발 2021. 10. 29. 23:50
logging-slf4j.md 가장 간단한 방법 System.out.println() 을 이용하기 로그의 양이나 로그 레벨을 조절 할 수 없다. 출력된 로그를 파일 등에 저장하기 불편하다 느리다. 1) java.util.logging JDK 1.4 부터 포함된 표준 로깅 API 2) Apache Commons logging 3) Log4j 4 SLF4J - logging Facade(퍼사드) SLF4J 는 로깅 퍼사드임. 로깅에 대한 추상 레이어를 제공하는 interface 왜 쓰는가? 어플리케이션은 SLF4J 를 사용해서 어떤 로깅 라이브러리를 쓰더라도 같은 방식으로 로그를 남겨야함 로그 라이브러리를 교체하더라도 코드 변경 불필요 4) Logback 로깅 퍼사드의 구현체 중 하나임 이점 오랫동안 검증 ..
-
[Web] Web Server 와 WAS개발 2021. 10. 28. 19:07
WAS 와 Web Server 웹서버 웹서버는 클라이언트로부터 요청을 받아서 정적인 컨텐츠를 내려준다. 혹은 HTTP 프로토콜을 기반으로 하여 클라이언트(웹 브라우저 또는 웹 크롤러)의 요청을 서비스 하는 기능을 담당한다. 기능 1) 정적인 컨텐츠 제공 WAS를 거치지 않고 바로 자원을 제공한다. 기능 2) 동적인 컨텐츠 제공을 위한 요청 전달 HTTP 형태로 Request 와 Response 를 주고 받을 수 있다. 클라이언트의 요청(Request)을 WAS에 보내고, WAS가 처리한 결과를 클라이언트에게 전달(응답, Response)한다. WAS DB 조회나 다양한 로직 처리를 요구하는 동적인 컨텐츠를 제공하기 위해 만들어진 Application Server 웹 컨테이너, 서블릿 컨테이너 라고도 말한..
-
Http 파라미터 방식과 멱등성개발 2021. 10. 28. 19:05
Http 파라미터 받는 방식 정리 오늘 좀 어이없는 이슈가 있었는데 정리해보려고 한다. 1. 오늘 있었던 일 프론트에서 특정 post method api 가 500 에러가 뜬다는 이슈 발생 swagger 에서 테스트해보니 너무 잘 동작함 즉 에러 재현이 안됨 프론트쪽에 request url 어떻게 보냈는지 여쭤 봄 프론트에서는 post method 이니 당연히 body data 로 파라미터를 보냄 그런데 그 api 는 query param 을 받는 post method api 였음 위 과정 약 1시간 반 소요.. 2. 문제 분석 path param, query param, body data 의 차이를 몰랐다 POST 에서는 늘 body data 로 파라미터를 받아 왔는데, 이 API 만 Query Par..