Conversation
Walkthrough
Changes
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/start.sh`:
- Line 22: The nohup invocation currently uses overwrite redirection (">") which
discards previous logs; update the launch in scripts/start.sh to append instead
(use ">>" for "$APP_LOG") or add a pre-start rotation/backup step that moves or
archives the existing "$APP_LOG" before running nohup with JAR_FILE so
historical logs (crash traces) are preserved; update the nohup line and/or add a
short rotation block referencing APP_LOG and JAR_FILE accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| chmod 755 $JAR_FILE | ||
| echo "$TIME_NOW > $JAR_FILE 파일 실행" >> $DEPLOY_LOG | ||
| nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE & | ||
| nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE > "$APP_LOG" 2>&1 < /dev/null & |
There was a problem hiding this comment.
재시작 시 이전 로그 손실 가능성
> 리다이렉션은 파일을 덮어쓰므로 애플리케이션 재시작 시 이전 실행의 로그(크래시 원인 등)가 손실됩니다. >>를 사용하여 append 모드로 변경하거나, 시작 전 로그 백업/로테이션 로직 추가를 권장합니다.
🔧 Append 모드로 변경 제안
-nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE > "$APP_LOG" 2>&1 < /dev/null &
+nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE >> "$APP_LOG" 2>&1 < /dev/null &또는 시작 전 로테이션 로직 추가:
# 시작 전 기존 로그 백업 (선택적)
if [ -f "$APP_LOG" ]; then
mv "$APP_LOG" "$APP_LOG.$(date +%Y%m%d_%H%M%S)"
fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/start.sh` at line 22, The nohup invocation currently uses overwrite
redirection (">") which discards previous logs; update the launch in
scripts/start.sh to append instead (use ">>" for "$APP_LOG") or add a pre-start
rotation/backup step that moves or archives the existing "$APP_LOG" before
running nohup with JAR_FILE so historical logs (crash traces) are preserved;
update the nohup line and/or add a short rotation block referencing APP_LOG and
JAR_FILE accordingly.
There was a problem hiding this comment.
@jiyun921, 네, 해당 부분이 주요 포인트입니다! 👍
현재 > 리다이렉션을 사용하면 애플리케이션이 재시작될 때마다 application.log 파일이 덮어쓰기되어 이전 실행의 로그(특히 크래시 원인)가 사라집니다.
가장 간단한 수정은 >> (append 모드)로 변경하는 것입니다:
-nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE > "$APP_LOG" 2>&1 < /dev/null &
+nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE >> "$APP_LOG" 2>&1 < /dev/null &혹은 로그가 너무 커지는 것이 우려된다면, 시작 전 로테이션 방식도 고려해보실 수 있습니다:
# jar 파일 실행 전 기존 로그 백업
if [ -f "$APP_LOG" ]; then
mv "$APP_LOG" "$APP_LOG.$(date +%Y%m%d_%H%M%S)"
fi
nohup java -jar -Dspring.profiles.active=prod -Xms256m -Xmx256m $JAR_FILE > "$APP_LOG" 2>&1 < /dev/null &운영 환경에서 장애 분석이 필요할 경우를 대비해 append 모드(>>) 변경을 권장드립니다! 🐇
#️⃣ 이슈
📌 요약
🛠️ 상세
💬 기타
Summary by CodeRabbit
릴리스 노트
application.log파일로 리다이렉트하도록 업데이트했습니다. 이를 통해 애플리케이션 로그가 파일에 저장되어 더욱 체계적인 로그 관리가 가능해졌습니다.