Log4Net: Logging in 2 byte languages (japanese, chinese etc.)

后端 未结 1 1588
忘掉有多难
忘掉有多难 2021-02-02 08:34

I would like to log data to a file in 2 byte languages (chinese, japanese etc) using log4net.

How to properly configure log4net to do that?

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 08:51

    The log file encoding is specified by FileAppender.Encoding. It can be configured using the encoding configuration element. Example:

    
        
        
        ...
    

    The value is the code page name. The corresponding Encoding is obtained using the System.Text.Encoding.GetEncoding(string) method. For a list of code pages, see the Encoding class documentation.

    0 讨论(0)
提交回复
热议问题