Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15211

Unify logger format for all components in tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha3
    • None

    Description

      When we use Ignite logger in the tests, logger records looks ugly and useless:

      <E8><FE><EB>. 29, 2021 7:19:45 PM org.apache.ignite.lang.IgniteLogger logInternal
      INFO: Node unitest:192.168.88.177:5003 received HeartbeatResponse from 192.168.88.177:5005 prevLogIndex=2001 prevLogTerm=1
      <E8><FE><EB>. 29, 2021 7:19:45 PM org.apache.ignite.lang.IgniteLogger logInternal
      INFO: Node unitest:192.168.88.177:5003 received HeartbeatResponse from 192.168.88.177:5004 prevLogIndex=2001 prevLogTerm=1
      <E8><FE><EB>. 29, 2021 7:19:45 PM org.apache.ignite.lang.IgniteLogger logInternal
      INFO: Node unitest:192.168.88.177:5003 received HeartbeatResponse from 192.168.88.177:5006 prevLogIndex=0 prevLogTerm=0
      <E8><FE><EB>. 29, 2021 7:19:45 PM org.apache.ignite.lang.IgniteLogger logInternal
      INFO: Node <unitest/192.168.88.177:5003> received receipt from 192.168.88.177:5006, isOk true
      

      and all messages put down only system out.
      I think need to make format better and stores it to file. It should contain:

      1. Timestamp with milliseconds
      2. Thread name
      3. Log message level

      I propose a message format like it was in the Ignite 2:

      %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

      These new format should be applied for all tests for each existed modules.

      UPD: the formatting looks like this:

      2021-08-11 15:41:39:205 +0300 [INFO][sc-cluster-3345-2][Transport] Stopping 172.25.4.112:3345
      2021-08-11 15:41:39:205 +0300 [INFO][sc-cluster-3345-2][Transport] Stopped 172.25.4.112:3345
      

      which means

      timestamp [loggin level][thread name][logger name] log record
      

      Also, we have added the ability to write logs to file and to console, for tests they are places in a "target" folder of the module where tests are presented

      Attachments

        Issue Links

          Activity

            People

              maliev Mirza Aliev
              v.pyatkov Vladislav Pyatkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 10h
                  10h
                  Remaining:
                  Time Spent - 40m Remaining Estimate - 9h 20m
                  9h 20m
                  Logged:
                  Time Spent - 40m Remaining Estimate - 9h 20m
                  40m