Log not found by running as a deployment but in a pod

Hi @agalisteo

I’m not entirely certain of the exact steps I took to resolve this issue, as it’s been quite some time since it was initially posted. I can only recall that the issue stemmed from either misconfigured log files or a problem in the Dockerfile used to generate the application image.

I will share what I got to resolve this or that problem and hope it can help.

application-dev.yaml

logging:
  file:
    path: jiraAddon/logs/${MY_POD_NAME:default}

demployment.yaml

******
******
          env:
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
          volumeMounts:
            - name: logs
              mountPath: /home/web/jiraAddon/logs
******
******

      volumes:
        - name: logs
          persistentVolumeClaim:
            claimName: addon-log-pvc

Dockerfile

FROM openjdk:11

WORKDIR /home/web

ARG PROFILE
ENV PROFILE_ENV ${PROFILE}

# RUN echo "Asia/Shanghai" > /etc/timezone

ENV TZ=Asia/Shanghai

COPY atlassian-connect-spring-boot-sample-thymeleaf-2.0-SNAPSHOT.jar /home/web

CMD java -jar /home/web/atlassian-connect-spring-boot-sample-thymeleaf-2.0-SNAPSHOT.jar --spring.profiles.active=$PROFILE_ENV