Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-166

This(1.2.10) doesn't support output TAB character as previous build(1.2.9) anymore, all TAB will be replaced as SPACE char.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.10
    • Component/s: Appenders
    • Labels:
      None
    • Environment:
      Windows XP/2003 with log4net 1.2.10 and .net 2.0 runtime.

      Description

      Here is my conversation pattern for output:
      "%c [%t] %p %d

      {yyyy/MM/dd HH:mm:ss:ffff}

      %X

      {rquid}

      %m%n"

      PS. I found this web page in html format does not display [TAB] well, but I used [TAB] on above one, not [SPACE].

      Using LayoutType : "log4net.Layout.PatternLayout"

      I use "\t"(TAB Char) to separate each column, it did work in log4net 1.2.9(.net 1.1), then I can use String.Split('\t') to split it.
      After I replace old dll with log4net 1.2.10 build on running on .net 2.0, it doesn't work anymore.
      All TAB char will be replaced to be SPACE char.

      Is it a bug or any other workaround to make possibility on output TAB char as before?

        Activity

        Hide
        dhvik Dan Händevik added a comment -

        Try to use html escaped code for tab instead of %t

        /Dan

        Show
        dhvik Dan Händevik added a comment - Try to use html escaped code for tab instead of %t /Dan
        Hide
        tomtang0406 Tom Tang added a comment -

        Hi, Dan:
        I think you misunderstand my problem...
        Actually, [%t] is not [tab] char, it does present [thread ID] in log content.
        My problem is, when I design the conversation pattern with using tab char to separate each column in my log content, it will be replaced as space char, and I don't like this behavior.

        Show
        tomtang0406 Tom Tang added a comment - Hi, Dan: I think you misunderstand my problem... Actually, [%t] is not [tab] char, it does present [thread ID] in log content. My problem is, when I design the conversation pattern with using tab char to separate each column in my log content, it will be replaced as space char, and I don't like this behavior.
        Hide
        dhvik Dan Händevik added a comment -

        Sorry, I do know that %t is the thread id, must had mixed up the typing.
        My suggestion is that you should use the escape sequence instead of tab in your pattern
        Like
        "%c [%t] %p %d

        {yyyy/MM/dd HH:mm:ss:ffff}

        %X

        {rquid}

        %m%n"

        This works for me and I get the real tab in my log output.

        Show
        dhvik Dan Händevik added a comment - Sorry, I do know that %t is the thread id, must had mixed up the typing. My suggestion is that you should use the escape sequence instead of tab in your pattern Like "%c [%t] %p %d {yyyy/MM/dd HH:mm:ss:ffff} %X {rquid} %m%n" This works for me and I get the real tab in my log output.
        Hide
        tomtang0406 Tom Tang added a comment -

        Hi, Dan:
        Sorry for response late.
        I had tried your solution, and it's truly working fine with it!!
        I appreciate your answer very much.

        Lots of thank!

        Show
        tomtang0406 Tom Tang added a comment - Hi, Dan: Sorry for response late. I had tried your solution, and it's truly working fine with it!! I appreciate your answer very much. Lots of thank!
        Hide
        tomtang0406 Tom Tang added a comment -

        Thought the [tab] char in conversation pattern doesn't work as old version(1.2.9), however I got the other workaround by Dan's suggestion – use to instead of using [tab] char.

        Show
        tomtang0406 Tom Tang added a comment - Thought the [tab] char in conversation pattern doesn't work as old version(1.2.9), however I got the other workaround by Dan's suggestion – use to instead of using [tab] char.

          People

          • Assignee:
            Unassigned
            Reporter:
            tomtang0406 Tom Tang
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development