3 Replies
      Latest reply on May 7, 2019 1:52 PM by jerrykrinock
      TheDarkKnight Level 1 Level 1 (10 points)

        We've been using ASL debugging logs without issue, but are now having problems with the new Unified Logging.

         

        It appears that our debug logs are being truncated to 1k messages and our debug log messages exceed this. Our messages are JSON formatted, so we can parse them and they provide human readability in a clear format, so we don't want to have to break them up.

         

        Updating our log function calls to the new logging functions makes no difference.

         

        Am I right that the truncation is due to the size of the internal stream buffers and if so, is there a way to increase them?

        • Re: Increase the unified logging stream buffer
          eskimo Apple Staff Apple Staff (11,655 points)

          The log message size limit is a documented feature of the API.  The exact limit is discussed in the header comments for os_log in <os/log.h>.  AFAIK there’s no way around this.  The general recommendation is that you focus the logging on the critical aspects that would need to support in-the-field debugging.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Increase the unified logging stream buffer
              TheDarkKnight Level 1 Level 1 (10 points)

              Hi Quinn,

               

              Thanks for replying so promptly and pointing me towards the documentation, but it doesn't appear to function according to the comments. Each log function has the same section in its comments: -

               

              * There is a physical cap of 256 bytes per entry for dynamic content,

              * i.e., %s and %@, that can be written to the persistence store.  As such,

              * all content exceeding the limit will be truncated before written to disk.

              * Live streams will continue to show the full content.

               

              According to the last line, it states that live streams should show full content, but I'm seeing this truncated to 1024 bytes, both on the command line and in the Console application, regardless of the logging function used.