# ========================================
# 기본 애플리케이션 설정
# ========================================
server.port=8080
server.servlet.context-path=/service
spring.application.name=bio_backend
spring.output.ansi.enabled=always

# ========================================
# 개발 도구 설정
# ========================================
spring.devtools.livereload.enabled=true
spring.devtools.restart.additional-paths=src/main/java

# ========================================
# 데이터베이스 설정
# ========================================
spring.datasource.url=jdbc:postgresql://stam.kr:15432/imas
spring.datasource.username=imas_user
spring.datasource.password=stam1201
spring.datasource.driver-class-name=org.postgresql.Driver

# ========================================
# JPA/Hibernate 설정
# ========================================
spring.jpa.hibernate.ddl-auto=none
spring.jpa.open-in-view=false
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.highlight_sql=true
spring.jpa.properties.hibernate.use_sql_comments=false

# 스키마 생성 설정
spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create
spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=ddl/schema.sql
spring.jpa.properties.hibernate.hbm2ddl.schema-generation.script.append=false

# ========================================
# 로그 레벨 설정
# ========================================
# 전체 애플리케이션 기본 로그 레벨
logging.level.root=INFO

# 프로젝트 패키지 로그 레벨
logging.level.com.bio.bio_backend=DEBUG

# 세부 패키지별 로그 레벨 
logging.level.com.bio.bio_backend..*.controller=INFO
logging.level.com.bio.bio_backend..*.service=DEBUG
logging.level.com.bio.bio_backend..*.repository=DEBUG
logging.level.com.bio.bio_backend.global.aop=DEBUG
logging.level.com.bio.bio_backend.global.filter=INFO

# JPA/Hibernate 로깅
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.orm.jdbc.bind=TRACE
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
logging.level.org.springframework.data.jpa=DEBUG
logging.level.org.springframework.orm.jpa=INFO
logging.level.org.springframework.transaction=DEBUG

# Spring Framework 로깅
logging.level.org.springframework.web=WARN
logging.level.org.springframework.web.servlet.DispatcherServlet=WARN
logging.level.org.springframework.security=INFO


# ========================================
# 로그 패턴 설정
# ========================================
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
logging.pattern.file=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n

# ========================================
# P6Spy 설정 (SQL 로깅)
# ========================================
decorator.datasource.p6spy.enable-logging=true
decorator.datasource.p6spy.log-format=%(sqlSingleLine)

# ========================================
# JWT 설정
# ========================================
token.expiration_time_access=900000
token.expiration_time_refresh=604800000
token.secret_key=c3RhbV9qd3Rfc2VjcmV0X3Rva2Vuc3RhbV9qd3Rfc2VjcmV0X3RhbV9qd3Rfc2VjcmV0X3RhbV9qd3Rfc2VjcmV0X3Rva2Vu

# ========================================
# Swagger 설정
# ========================================
springdoc.api-docs.path=/api-docs
springdoc.swagger-ui.path=/swagger-ui.html
springdoc.swagger-ui.operationsSorter=method
springdoc.swagger-ui.tagsSorter=alpha
springdoc.swagger-ui.doc-expansion=none
springdoc.swagger-ui.disable-swagger-default-url=true
springdoc.default-produces-media-type=application/json
springdoc.default-consumes-media-type=application/json