Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-13317

Default logging we ship will incorrectly print "?:?" for "%F:%L" pattern due to includeCallerData being false by default no appender

    XMLWordPrintableJSON

Details

    • Normal

    Description

      We specify the logging pattern as "%-5level [%thread] %date

      {ISO8601}

      %F:%L - %msg%n".

      %F:%L is intended to print the Filename:Line Number. For performance reasons logback (like log4j2) disables tracking line numbers as it requires the entire stack to be materialized every time.

      This causes logs to look like:
      WARN [main] 2017-03-09 13:27:11,272 ?:? - Protocol Version 5/v5-beta not supported by java driver
      INFO [main] 2017-03-09 13:27:11,813 ?:? - No commitlog files found; skipping replay
      INFO [main] 2017-03-09 13:27:12,477 ?:? - Initialized prepared statement caches with 14 MB
      INFO [main] 2017-03-09 13:27:12,727 ?:? - Initializing system.IndexInfo

      When instead you'd expect something like:
      INFO [main] 2017-03-09 13:23:44,204 ColumnFamilyStore.java:419 - Initializing system.available_ranges
      INFO [main] 2017-03-09 13:23:44,210 ColumnFamilyStore.java:419 - Initializing system.transferred_ranges
      INFO [main] 2017-03-09 13:23:44,215 ColumnFamilyStore.java:419 - Initializing system.views_builds_in_progress

      The fix is to add "<includeCallerData>true</includeCallerData>" to the appender config to enable the line number and stack tracing.

      Attachments

        1. 13317_v1.diff
          1 kB
          Michael Kjellman

        Activity

          People

            mkjellman Michael Kjellman
            mkjellman Michael Kjellman
            Michael Kjellman
            Ariel Weisberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: