Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-963

Location Info is not rigth

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • None
    • None
    • Pattern Converters
    • production

    Description

      HI.
      This bug is for Log4j 1.2.17 and I am not sure if it is also in 2.0. When org.apache.log4j.spi.LocationInfo get information of the class who write the log (looking for in the stack trace), there is two things:

      1. Performance. In the constructor LocationInfo(Throwable t, String fqnOfCallingClass) is better walk from index 0 to straceTrace.length - 1 instead of in reverse. The log wrraped class is very much nearest of index 0 than index straceTrace.length - 1.

      2. Bug. If the log wrapped class twice appears twice o more times in the stacktrace, you always get the first, when the right would be get the last. For this reason, you have to walk from index 0 to straceTrace.length - 1 instead of in reverse.

      Regards.

      P.D.: Please, it would be possible you generate log4j-1.2.18 with this fix? Thanks.

      Attachments

        Activity

          People

            Unassigned Unassigned
            AntonioSimon Antonio Jesus Simon Escanez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: