Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6013

NiFi Docker Environment Variable for enabling debug logging of NiFi inside a Docker container

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Docker
    • None

    Description

      I have a slight improvement to Environment variables that the NiFI docker system uses to bootstrap its nifi.properties files

      There are times, when learning NiFi, that I want to stop and start NiFi with debugging on. If NiFi was running inside a Docker container it was hard.

      What I did was I created a new environment variable within the NiFi bootstrapping system it uses to start itself up inside a docker container. I have documented all NiFI environment variables here.

      https://github.com/dprophet/nifi/blob/master/nifi-docker/dockerhub/CONFIGURATION.md

      I just pushed some code for review
      https://github.com/dprophet/nifi/commit/ea31ac6bd8f00944166e3e230af2040636c0505c

      What I did was introduce a new environment variable

      NIFI_DEBUG

      And in file
      https://github.com/apache/nifi/blob/master/nifi-docker/dockerhub/sh/start.sh

      I added

      if [[ -n $NIFI_DEBUG ]] ; then
      . "${scripts_dir}/update_logback.sh"
      fi

      Basically what it does, if the NIFI_DEBUG is set
      Example:

      NIFI_DEBUG="org.apache.nifi.web.security=TRACE,org.apache.nifi.authorization=DEBUG,org.apache.nifi.web.api.config=TRACE"

      It updates the
      ${NIFI_HOME}/conf/logback.xml

      File to enable the debugging modes of NiFi

      This is a very fast mechanism to restart NiFi with debugging turned on. Very developer and workflow friendly.

      If of interest I will give a pull request.

      What about the documentation I created?

      Attachments

        Activity

          People

            Unassigned Unassigned
            ErikAnderson Erik Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: