glassfish
  1. glassfish
  2. GLASSFISH-21573

Server log messages are unexpectedly trimmed if the message starts with or ends with spaces.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1, 4.1.1, 5.0
    • Fix Version/s: None
    • Component/s: logging
    • Labels:
      None

      Description

      Server log messages are unexpectedly trimmed if the message starts with or ends with spaces.

      ex)

      System.out.println("               Hello, World!               ");
      

      server.log

      [2016-10-31T12:53:28.009+0900] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=36 _ThreadName=Thread-8] [timeMillis: 1477886008009] [levelValue: 800] [[
        Hello, World!]]
      

      This is the patch for this problem.

      LoggingOutputStream.java flush()
      -        logMessage = logMessage.trim();
      -        if (logMessage.length() == 0 || logMessage.equals(lineSeparator)) {
      +        if (logMessage.trim().length() == 0 || logMessage.trim().equals(lineSeparator)) {
                  // avoid empty records
                  return;
              }
      

        Activity

        Hide
        Kokil_Jain added a comment -

        Fixed by r64406

        Show
        Kokil_Jain added a comment - Fixed by r64406

          People

          • Assignee:
            Kokil_Jain
            Reporter:
            yama0428
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: