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

java.sql.Time objects are incorrectly formatted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.20.0
    • None
    • None

    Description

      Log4j2 incorrectly formats instance objects of java.sql.Time. Consider following case -

      final Time time = Time.valueOf("12:00:00");
      logger.info("Time : {}", time);

       
      Now, the expected output is Time : 12:00:00 but instead it is logged as Time : 1970-01-01T12:00:00.000+0530. Since java.sql.Time has no date component, it is wrong to format it this way.
       

      Attachments

        Activity

          People

            rgoers Ralph Goers
            kedarjoshi Kedar Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: