개발 기록

220124 springboot - application.yml 설정 본문

TIL

220124 springboot - application.yml 설정

수염차 2022. 1. 24. 16:04

예전에 프로젝트 한거 가져와서 찾아보기

 

spring:
  datasource:
    url: ${MYSQL_URL}
    username: ${MYSQL_USERNAME}
    password: ${MYSQL_PW}
    driver-class-name: com.mysql.cj.jdbc.Driver

  jpa:
    properties:
      hibernate:
        format_sql: true
    hibernate:
      ddl-auto: none
    generate-ddl: true
    open-in-view: false

logging:
  level:
    org:
      hibernate:
        SQL: debug
        type:
          descriptor:
            sql: trace
    com:
      amazonaws:
        util:
          EC2MetadataUtils: error

jwt:
  secret: ${JWT_SECRET}

cloud:
  aws:
    credentials:
      use-default-aws-credentials-chain: true
      accessKey: ${AWS_S3_ACCESS_KEY}
      secretKey: ${AWS_S3_SECRET_KEY}
    s3:
      bucket: ${AWS_S3_BUCKET_NAME}
    region:
      static: ap-northeast-2
    stack:
      auto: false

spring:
  datasource:
    url: ${MYSQL_URL}
    username: ${MYSQL_USERNAME}
    password: ${MYSQL_PW}
    driver-class-name: com.mysql.cj.jdbc.Driver

spring.datasource.url : 데이터베이스의 JDBC URL

spring.datasource.username : 데이터베이스의 로그인 사용자 이름

spring.datasource.password : 데이터베이스의 로그인 비밀번호

spring.datasource.driver-class-name : DBC 드라이버의 완전한 이름. 기본적으로 URL을 기반으로 자동 감지됨

spring:
  jpa:
    properties:
      hibernate:
        format_sql: true
    hibernate:
      ddl-auto: none
    generate-ddl: true
    open-in-view: false

hibernate.format_sql (예: true또는 false(기본값)) : 로그 및 콘솔에서 SQL을 예쁘게 인쇄

spring.jpa.hibernate.ddl-auto : DDL 모드. 임베디드 데이터베이스를 사용하고 스키마 관리자가 감지되지 않은 경우 기본값은 "create-drop". 그렇지 않으면 기본값은 "없음".

spring.jpa.generate-ddl (예: true또는 false(기본값)) : 시작 시 스키마를 초기화할지 여부

spring.jpa.open-in-view (예: true(기본값)또는 false) : OpenEntityManagerInViewInterceptor를 등록. 요청의 전체 처리를 위해 JPA EntityManager를 스레드에 바인딩.

logging:
  level:
    org:
      hibernate:
        SQL: debug
        type:
          descriptor:
            sql: trace
    com:
      amazonaws:
        util:
          EC2MetadataUtils: error

logging.level.* : 로그 수준 심각도 매핑. 원하는 로깅 수준 설정 가능

예를 들어 `logging.level.org.springframework=DEBUG`. 라면 로그 레벨이 DEBUG 이상인 경우에만 로그 출력

 

ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF.

ALL  사용자 정의 레벨을 포함한 모든 레벨.
DEBUG  애플리케이션을 디버그하는 데 가장 유용한 세분화된 정보 이벤트를 지정
INFO 대략적인 수준에서 응용 프로그램의 진행 상황을 강조하는 정보 메시지를 지정
WARN  잠재적으로 유해한 상황을 지정
ERROR  애플리케이션이 계속 실행되도록 허용할 수 있는 오류 이벤트를 지정
FATAL  응용 프로그램이 중단될 수 있는 매우 심각한 오류 이벤트를 지정
OFF 가능한 가장 높은 순위이며 로깅을 해제하기 위한 것
TRACE DEBUG보다 세분화된 정보 이벤트를 지정

 

cloud:
  aws:
    credentials:
      use-default-aws-credentials-chain: true
      accessKey: ${AWS_S3_ACCESS_KEY}
      secretKey: ${AWS_S3_SECRET_KEY}
    s3:
      bucket: ${AWS_S3_BUCKET_NAME}
    region:
      static: ap-northeast-2
    stack:
      auto: false

cloud.aws.credentials.use-default-aws-credentials-chain (예: true또는 false(기본값)) : 사용자 지정 자격 증명 체인을 구성하는 대신 DefaultAWSCredentials Chain을 사용

cloud.aws.stack.auto (예: true(기본값)또는 false) : 애플리케이션에 대한 자동 스택 이름 감지를 활성화

 

+

AWS Credentials

AWS 서비스를 CLI 환경에서 사용하기 위해서 필요한 인증 수단

Amazon Web Services에 요청하려면 AWS 자격 증명을 AWS SDK for Java에 제공해야 한다.

https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html

 

 

 

출처

log4j - Logging Levels

 

log4j - Logging Levels

log4j - Logging Levels The org.apache.log4j.Level levels. You can also define your custom levels by sub-classing the Level class. Level Description ALL All levels including custom levels. DEBUG Designates fine-grained informational events that are most use

www.tutorialspoint.com

Common Application properties

 

Common Application properties

 

docs.spring.io

부록 A: 일반적인 애플리케이션 속성

 

Common application properties

Various properties can be specified inside your application.properties file, inside your application.yml file, or as command line switches. This appendix provides a list of common Spring Cloud AWS properties and references to the underlying classes that co

docs.spring.io

Hibernate ORM 5.2.18.최종 사용자 가이드

 

Hibernate ORM 5.2.18.Final User Guide

Fetching, essentially, is the process of grabbing data from the database and making it available to the application. Tuning how an application does fetching is one of the biggest factors in determining how an application will perform. Fetching too much dat

docs.jboss.org

 

Comments