diff --git a/.github/workflows/core-application-prod-ci-cd-flow.yml b/.github/workflows/core-application-prod-ci-cd-flow.yml index b5f8ecf6..7a0839d5 100644 --- a/.github/workflows/core-application-prod-ci-cd-flow.yml +++ b/.github/workflows/core-application-prod-ci-cd-flow.yml @@ -125,9 +125,9 @@ jobs: docker ps -q --filter "name=core" | xargs -r docker stop docker ps -aq --filter "name=core" | xargs -r docker rm aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username ${{ secrets.AWS_DOCKER_USER }} --password-stdin ${{ secrets.AWS_USER_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - docker image prune -f + docker image prune -f -a docker pull ${{ steps.meta.outputs.tags }} - docker run -d -p 8080:8080 -e ENVIRONMENT=prod --name core --network ec2-user_backend ${{ steps.meta.outputs.tags }} + docker run -d -p 8080:8080 -e ENVIRONMENT=prod -v /home/ec2-user/logs:/logs --name core --network ec2-user_backend ${{ steps.meta.outputs.tags }} - name: Remove Github Actions IP from security group if: always() diff --git a/.github/workflows/core-application-test-ci-cd-flow.yml b/.github/workflows/core-application-test-ci-cd-flow.yml index bd2f4ee1..3ad7ecca 100644 --- a/.github/workflows/core-application-test-ci-cd-flow.yml +++ b/.github/workflows/core-application-test-ci-cd-flow.yml @@ -125,9 +125,9 @@ jobs: docker ps -q --filter "name=core" | xargs -r docker stop docker ps -aq --filter "name=core" | xargs -r docker rm aws ecr get-login-password --region ${{ secrets.AWS_REGION }} | docker login --username ${{ secrets.AWS_TEST_ENV_DOCKER_USER }} --password-stdin ${{ secrets.AWS_TEST_ENV_USER_ID }}.dkr.ecr.${{ secrets.AWS_REGION }}.amazonaws.com - docker image prune -f + docker image prune -f -a docker pull ${{ steps.meta.outputs.tags }} - docker run -d -p 8080:8080 -e ENVIRONMENT=container --name core --network test_backend ${{ steps.meta.outputs.tags }} + docker run -d -p 8080:8080 -e ENVIRONMENT=container -v /home/ec2-user/logs:/logs --name core --network test_backend ${{ steps.meta.outputs.tags }} - name: Remove Github Actions IP from security group if: always() diff --git a/.gitignore b/.gitignore index 0fd891e4..922d6f84 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ backend/data +backend/docker-volumes + .env \ No newline at end of file diff --git a/backend/core/src/main/resources/logback-spring.xml b/backend/core/src/main/resources/logback-spring.xml index f9ba2a0c..4b25a32d 100644 --- a/backend/core/src/main/resources/logback-spring.xml +++ b/backend/core/src/main/resources/logback-spring.xml @@ -1,55 +1,34 @@ - - - http://10.0.0.8:3100/loki/api/v1/push - - - - - - { - "level":"%level", - "class":"%logger{36}", - "thread":"%thread", - "message": "%message", - "requestId": "%X{X-Request-ID}" - } - - - - - - - - %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n + + [%d{yyyy-MM-dd HH:mm:ss}:%-3relative][%thread] %-5level %logger{36} - %msg%n + + + + ./logs/info.log + + INFO + + + [%d{yyyy-MM-dd HH:mm:ss}:%-3relative][%thread] %-5level %logger{35} - %msg%n + + + ./logs/info.%d{yyyy-MM-dd}.%i.log.gz + + + 100MB + + 180 + - - - - - - - - - - - - - - + - + - - - - - + + \ No newline at end of file