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

SimpleProcessLogger substitutes the "Object[] + Throwable" arguments incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-M1, 1.22.0
    • None
    • None

    Description

      SimpleProcessLogger substitutes the log message arguments incorrectly when the Object[] + Throwable signature is used.

      The Object[] (containing the log message arguments) is treated as a single argument and the whole array is replaced in the first {} placeholder, while the remaining {} placeholders stay unresolved.

      Incorrect:

      2023-06-01 21:44:24,805 ERROR [Timer-Driven Process Thread-4] o.a.n.p.helloworld.HelloWorldProcessor [HelloWorldProcessor[id=73713c8d-0188-1000-4fcc-49c35b7d0a4e], foo, bar] Fatal error: arg1={}, arg2={}
      java.lang.Exception: Error occurred
      	at org.apache.nifi.processors.helloworld.HelloWorldProcessor.onTrigger(HelloWorldProcessor.java:95)
      	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
      

      Expected:

      2023-06-01 22:31:03,254 ERROR [Timer-Driven Process Thread-2] o.a.n.p.helloworld.HelloWorldProcessor HelloWorldProcessor[id=73713c8d-0188-1000-4fcc-49c35b7d0a4e] Fatal error: arg1=foo, arg2=bar
      java.lang.Exception: Error occurred
      	at org.apache.nifi.processors.helloworld.HelloWorldProcessor.onTrigger(HelloWorldProcessor.java:95)
      	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
      

      Attachments

        Issue Links

          Activity

            People

              turcsanyip Peter Turcsanyi
              turcsanyip Peter Turcsanyi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m