본문 바로가기
반응형

전체 글383

[jpa] 쿼리 로그 설정 jpa 쿼리가 보이는 설정을 하는건 크게 2가지가 있다. 1) show-sql 을 true로 설정하는 방법 2) p6spy를 이용한 로깅(외부라이브러리). 1번은 파라미터 안에 무엇이 들어있는지 알 순 없고 바인딩쿼리만 로그에 찍힌다. 2번은 추가설정을 좀 해주어야 한다. 1) show-sql을 사용하는 방법은 간단하다. application.properties 에다 다음이 설정을 추가하면 된다. spring.jpa.show-sql=false # 여기 spring.jpa.properties.hibernate.format_sql=false # 여기 spring.jpa.hibernate.ddl-auto=none spring.jpa.hibernate.generate-ddl=true spring.jpa.hibe.. 2021. 1. 15.
[axios, react, redux] 서버통신 시 로딩바 띄우기 axios를 이용해 Backend와 API통신하면서 중간에 로딩바가 필요했다. 그런데 이걸 매번 호출마다 넣을 순 없으니 axios의 interceptors 옵션을 이용해 넣기로 했다. 우선 Loading 화면을 우선 만든다. 해당 로딩화면은 항상 최상위어야 한다. 다음처럼 컴포넌트를 만들어 Root에 추가했다. 로딩이미지는 material-ui에 있는 것을 사용했다. https://material-ui.com/api/circular-progress/ CircularProgress API - Material-UI The API documentation of the CircularProgress React component. Learn more about the props and the CSS custom.. 2021. 1. 13.
[springboot] 자주쓰는 정보 파라미터에 설정해 자동 주입하여 받기(resolver 사용) Spring Security Oauth2 를 이용해 로그인을 할 경우, Principal를 이용해 name을 조회할 수 있는데, 여기서 한단계 더 나아가 유저정보를 가지고 있어야 할때가 있다. 이럴때 아마 principal.getName()을 이용해 유저정보를 조회한 후 회원정보를 불러올 것이다. ... public String testUser(Principal principal) { User findUser = loginMapper.findUserInfoByUserEmail(principal.getName()); ... } ... 아마 로그인을 이용한 정보는 거의 대부분의 비지니스 로직에서 쓸텐데 그렇다면 위 코드를 매번 삽입해야 한다. 이부분을 생략하고자 설정하는 것이다. 일전에 AOP를 이용해 어노.. 2021. 1. 11.
[aws] aws cli로 s3 파일 삭제(console에서 파일삭제 실패 시-파일명 한글일 경우 실패함) aws s3파일 중에 한글로 되어있는 경우 console 에서 지우는데 계속 실패하여 aws cli로 지우기로 했다. 오랜만에 aws cli를 사용하는데, 다음의 에러가 발생했다. $ aws zsh: /usr/local/bin/aws: bad interpreter: /usr/local/opt/python/bin/python3.7: no such file or directory 찾아보니 클라이언트를 재설치하란 말이 있어서 재설치 하기로 했다. 참고로 이번 환경은 macOS에서 한 것이다 brew reinstall awscli 다음으로 awscli 를 실행하는 링크를 재연결한다 $ brew link --overwrite awscli Linking /usr/local/Cellar/awscli/2.0.44..... 2021. 1. 8.
[nginx] aws에 nginx설치 및 멀티도메인 설정(reverse-proxy) AWS에 설치하기 전에 yum 버전을 최신으로 업데이트 해준다 sudo yum update -y nginx 를 설치하려고 하면 다음과 같은 메세지가 나온다. Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00:00 No package nginx available. Error: Nothing to do nginx is available in Amazon Linux Extra topic "nginx1" To use, run # sudo amazon-linux-extras install nginx1 Learn more at https://aws.amazon.com/amazon-linux-2.. 2021. 1. 6.
[airflow] BigQueryOperator 사용할때 location 에러 다음에러가 떴을 경우. ... 'errors': [{'reason': 'notFound', 'message': 'Not found: Dataset [프로젝트명]:`[dateset이름] was not found in location US'}] ... 내 경우 데이터셋을 서울리전(asia-northeast3) 에 저장하게 했는데, 기본값은 US여서 문제가 발생한줄 알고 찾았다. BigQueryOperator의 파라미터중 location이 있길래 옵션으로 다음처럼 넣어봤는데도 동일한 에러가 났다. checker = BigQueryOperator( dag=dag , task_id='bq_check_exist_table' , sql=sql , location='asia-northeast3' ) 첫번째 실험은 lo.. 2021. 1. 4.
반응형