title: Logback: Logging JSON doesn't happen
body: <p>Here is my appender for writing logs to file (part of logback.xml):        </p>
  
  <pre><code>&lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;file&gt;logs/ps_gate_server.log&lt;/file&gt;
      &lt;encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"&gt;
      &lt;Pattern&gt;%d{dd-MM-yyyy} %d{HH:mm:ss.SSS} [%-19.19t] [%-5p] [%-1.40X{OperationName};%-1.10X{ClientID};%-1.20X{PayID}] %m%n &lt;/Pattern&gt;
      &lt;/encoder&gt; 
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
          &lt;FileNamePattern&gt;logs/ps_gate_server.%d{yyyy-MM-dd}.%i.log.zip&lt;/FileNamePattern&gt;
          &lt;timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
             &lt;!-- or whenever the file size reaches 100MB --&gt;
             &lt;maxFileSize&gt;100MB&lt;/maxFileSize&gt;
          &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
      &lt;/rollingPolicy&gt;
  &lt;/appender&gt;
  </code></pre>
  
  <p>As seen, my encoder is <code>ch.qos.logback.classic.encoder.PatternLayoutEncoder</code> and everything works. I need to convert my logging to JSON format. For this I change my encoder to <code>net.logstash.logback.encoder.LogstashEncoder</code>:</p>
  
  <pre><code>&lt;appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
      &lt;file&gt;logs/ps_gate_server.log&lt;/file&gt;
      &lt;encoder class="net.logstash.logback.encoder.LogstashEncoder"&gt;
      &lt;Pattern&gt;%d{dd-MM-yyyy} %d{HH:mm:ss.SSS} [%-19.19t] [%-5p] [%-1.40X{OperationName};%-1.10X{ClientID};%-1.20X{PayID}] %m%n &lt;/Pattern&gt;
      &lt;/encoder&gt; 
      &lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
          &lt;FileNamePattern&gt;logs/ps_gate_server.%d{yyyy-MM-dd}.%i.log.zip&lt;/FileNamePattern&gt;
          &lt;timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"&gt;
          &lt;!-- or whenever the file size reaches 100MB --&gt;
          &lt;maxFileSize&gt;100MB&lt;/maxFileSize&gt;
      &lt;/timeBasedFileNamingAndTriggeringPolicy&gt;
      &lt;/rollingPolicy&gt;
  &lt;/appender&gt;
  </code></pre>
  
  <p>Then, when the program starts, the program does not create the file ps_gate_server.log. If someone knows, prompt please. All necessary jars are there.</p>