Skip to content

Commit 7e0b00a

Browse files
JIWONKIMSclaude
andauthored
fix(be): Disable SQL logging in production and clean up security config (#126) (#127)
* fix(be): Disable SQL logging in production and clean up config - Disable SQL logging (org.hibernate.SQL: WARN) for production performance - Remove /weather/test1 test endpoint from security config - Add H2 console disable comment for clarity - Remove deprecated hibernate.dialect property 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs(be): Add comment explaining dialect removal - Add comment explaining why hibernate.dialect was removed - Hibernate 6.x auto-detects dialect from JDBC URL - Explicit dialect configuration is deprecated 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 5c03eed commit 7e0b00a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/kotlin/com/back/koreaTravelGuide/common/security/SecurityConfig.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class SecurityConfig(
6969
authorize("/webjars/swagger-ui/**", permitAll)
7070
authorize("/api/auth/**", permitAll)
7171
authorize("/actuator/health", permitAll)
72-
authorize("/weather/test1", permitAll)
7372
authorize("/favicon.ico", permitAll)
7473
if (isDev) {
7574
authorize(anyRequest, permitAll)

src/main/resources/application-prod.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
spring:
22
autoconfigure:
33
exclude:
4+
5+
h2:
6+
console:
7+
enabled: false # 프로덕션 환경에서 H2 Console 비활성화 (보안)
8+
49
datasource:
510
url: jdbc:postgresql://postgresql_1:5432/${SPRING__DATASOURCE__URL___DB_NAME}
611
username: ${SPRING_DATASOURCE_USERNAME} # local용 근접 접근 계정
@@ -13,7 +18,7 @@ spring:
1318
properties:
1419
hibernate:
1520
format_sql: true
16-
dialect: org.hibernate.dialect.PostgreSQLDialect
21+
# dialect 설정 제거: Hibernate 6.x부터 JDBC URL 기반으로 자동 감지되며, 명시적 설정은 deprecated됨
1722

1823
ai:
1924
vectorstore:
@@ -46,7 +51,7 @@ logging:
4651
com.back: INFO # 서비스 로그는 정보 레벨 이상만
4752
org.springframework.web: WARN # 웹 관련 경고/에러만
4853
org.springframework.security: WARN # 로그인 실패/보안 경고 위주
49-
org.hibernate.SQL: INFO # SQL 전체 로그는 끄고, 필요시 운영 중에만 열기
54+
org.hibernate.SQL: WARN # SQL 로그 비활성화 (프로덕션 성능 및 로그 용량 최적화). 디버깅 필요시 INFO로 변경
5055
pattern:
5156
console: "[%d{yyyy-MM-dd HH:mm:ss}] %-5level %logger{36} - %msg%n"
5257

0 commit comments

Comments
 (0)