title: Logback couldn't log asian characters correcly to files
body: <p>My Logback logs are displaying a lot of things like</p>
  
  <p>é»„å˜‰çš“</p>
  
  <p>in the log files whenever it encounters asian characters. It seems like the file is in unicode instead of UTF-8.</p>
  
  <p>This is my Logback groovy config</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>/*
   * Logback configuration in Groovy.
   * 
   * While this appears to be the Logback preference going forward you can still
   * use an XML configuration file by deleting this one and creating a 
   * logback.xml in its place.
   */
  
  import java.nio.charset.Charset
  import ch.qos.logback.classic.encoder.PatternLayoutEncoder
  import ch.qos.logback.core.ConsoleAppender
  
  import static ch.qos.logback.classic.Level.*
  
  def DEFAULT_PATTERN = "%d [%thread] %-5level %logger - %msg%n"
  
  appender("STDOUT", ConsoleAppender) {
   encoder(PatternLayoutEncoder) { 
    pattern = DEFAULT_PATTERN 
    charset = Charset.forName("UTF-8")
   }
  }
  
  appender("FILE", RollingFileAppender) {
    file = "logs/stdout.log"
    append = true
    encoder(PatternLayoutEncoder) {
      pattern = DEFAULT_PATTERN
      charset = Charset.forName("UTF-8")
    }
    filter(ch.qos.logback.classic.filter.ThresholdFilter) {
      level = INFO
    }
    rollingPolicy(ch.qos.logback.core.rolling.TimeBasedRollingPolicy) {
      fileNamePattern = "logs/stdout-%d{yyyy-MM-dd}.%i.log"
      maxHistory = 10
      timeBasedFileNamingAndTriggeringPolicy(ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP) {
        maxFileSize = "1MB"
      }
    }
  }
  
  appender("ERROR", RollingFileAppender) {
    file = "logs/errors.log"
    append = true
    encoder(PatternLayoutEncoder) {
      pattern = DEFAULT_PATTERN
      charset = Charset.forName("UTF-8")
    }
    filter(ch.qos.logback.classic.filter.ThresholdFilter) {
      level = ERROR
    }
    rollingPolicy(ch.qos.logback.core.rolling.TimeBasedRollingPolicy) {
      fileNamePattern = "logs/errors-%d{yyyy-MM-dd}.%i.log"
      maxHistory = 10
      timeBasedFileNamingAndTriggeringPolicy(ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP) {
        maxFileSize = "1MB"
      }
    }
  }
  
  /* Make Spring less verbose. */
  //logger("org.springframework", INFO)
  
  /* Quieten Thymeleaf. */
  //logger("org.thymeleaf", INFO)
  
  /* Jetty can be really noisy on a shaded jar. */
  //logger("org.eclipse.jetty.webapp.WebAppClassLoader", INFO)
  //logger("org.eclipse.jetty.util.resource.JarResource", INFO)
  
  /* Quieten Jetty in general. */
  //logger("org.eclipse", ERROR);
  
  def appenders = []
  appenders.add("STDOUT")
  appenders.add("FILE")
  appenders.add("ERROR")
  
  root(INFO, appenders)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Also, when I started my JAR, I also specified -Dfile.encoding=UTF-8.
  I really have no clue here how to fix this.</p>
  
  <p>Please let me know if you know what might be able to fix it.</p>
  
  <p>Thank you so much</p>