2 Replies Latest reply on Mar 9, 2014 9:26 PM by lili2013

    how to config log for supplementary characters

    lili2013

      I want to display supplementary characters in my log file.
      I set encoding=utf-8 like this,
      <periodic-rotating-file-handler name="ALL">
          <encoding value="utf-8"/>
          <formatter>
              <pattern-formatter pattern="%d [%t] [%-17c] - %m%n"/>
          </formatter>
          <file path="C:/logs/trace.log"/>
          <suffix value=".yyyy-MM-dd"/>
      </periodic-rotating-file-handler>
      But it doesn't work.
      I appreciate any guidance.Thanks.

      Regards
      Bates

        • 1. Re: how to config log for supplementary characters
          jamezp

          Could you define "doesn't work"? Do you mean the file doesn't have the UTF-8 BOM at the beginning?

           

          --

          James R. Perkins

          • 2. Re: how to config log for supplementary characters
            lili2013

            Hi,James

             

            Thanks for your reply.

             

            "doesn't work" means that  the supplementary characters were expected to be displayed though,

            "?" were displayed instead of the supplementary characters.

             

            After I deleted the old log file manually, the supplementary characters were written out well in my log file.

             

            I think that the original log file was made as SJIS encoding firstly,

            so after that althought I had changed my log4.xml,

            setting log file to UTF-8 encoding value,for the log file had been SJIS,

            the supplementary characters couldn't been written out well.

             

            Sorry for the late reply, and thank you very much!

             

            Regards

            Bates