Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73372

When using containerLog, the log does not display completely and stops in the middle.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • kubernetes-plugin
    • None

      I am trying to log a SpringBoot-based batch application using containerLog, and I have written the code as follows:

       

      podTemplate(yaml: """
                  apiVersion: v1
                  kind: Pod
                  spec:
                    volumes:
                    - name: log-storage
                      emptyDir: {}            
                    containers:
                    - name: batch-worker
                      image: ...
                      imagePullPolicy: Always
                      tty: true
                      env:
                        - name: JAVA_OPTS
                          value: "-Dnetworkaddress.cache.negative.ttl=0 -Xms1G -Xmx1G -XX:+UseZGC -XX:TieredStopAtLevel=2 -XX:MaxGCPauseMillis=50 -XX:CompileThreshold=200 -XX:MaxDirectMemorySize=100m
      -Dserver.port=8080 -Djava.security.egd=file:/dev/./urandom"
                      volumeMounts:
                      - mountPath: "/workspace/logs"
                        name: log-storage
      """) {
        node(POD_LABEL) {
          stage('Run Batch') {
            container('batch-worker') {
              containerLog(name: 'batch-worker')
            }
          }
        }
      }
       

      I want to see all logs through containerLog when the Jenkins pipeline job is written as above, but the Jenkins pipeline job ends with the logs only visible up to the middle.

      I have tried various parameters like returnLog, sinceSeconds, etc., but the logs disappear in the middle, and the position changes each time I run the Jenkins job.

      I am reporting this issue as a bug. Thank you.

            Unassigned Unassigned
            petercheon Peter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: