<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not remove this line. File tag: log_conf-APV-7.3.0. -->

<configuration scan="true" scanPeriod="10 seconds">

  <!--
    A custom StatusListener used to log the internal status of Logback.
    This custom implementation is similar to the standard OnConsoleStatusListener
    implementation but will only log WARN and ERROR messages from Logback's internal
    status and will log on the standard error instead of logging on the standard output.
  -->
  <StatusListener class="com.lightstreamer.logback.Logging$OnConsoleErrorWarningStatusListener" />

  <!--
    This Appender is provided by Lightstreamer Kernel.
    It has to be used in addition to other Appenders in order to make
    log messages available to the internal Monitoring Data Adapter.
    Generic Appender configuration elements are supported,
    but for message formatting instructions, which are ignored.
  -->
  <appender name="LSProducer" class="com.lightstreamer.logback.ProducerAppender">
    <!--
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>warn</level>
    </filter>
    -->
  </appender>

  <!--
    Typical configuration of file Appenders for log messages.

    This configuration takes advantage of a useful extension of Logback
    native Appender RollingFileAppender provided by Lightstreamer Kernel.
    The com.lightstreamer.logback.RelativeFileAppenders$RollingFileAppender
    Appender behaves like the native one, but resolves relative file name
    specifications by starting from the directory containing this
    configuration file.
    The com.lightstreamer.logback.RelativeFileAppenders$FileAppender Appender
    is also available.

    Note that the log file names used for different logback appenders should
    be different.
  -->
  <appender name="LSRolling" class="com.lightstreamer.logback.RelativeFileAppenders$RollingFileAppender">
    <!--
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>info</level>
    </filter>
    -->
    <File>../logs/ls.log</File>

    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <FileNamePattern>../logs/ls.log.%i</FileNamePattern>
      <MinIndex>1</MinIndex>
      <MaxIndex>5</MaxIndex>
    </rollingPolicy>

    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
      <MaxFileSize>1024KB</MaxFileSize>
    </triggeringPolicy>

    <encoder>
      <pattern>%d{"dd.MMM.yy HH:mm:ss,SSS"} &lt;%5.5(%p%marker)&gt; %m%n</pattern>
    </encoder>
  </appender>
  <appender name="LSDailyRolling" class="com.lightstreamer.logback.RelativeFileAppenders$RollingFileAppender">
    <!--
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>info</level>
    </filter>
    -->
    <File>../logs/Lightstreamer.log</File>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- daily rollover -->
      <fileNamePattern>../logs/Lightstreamer.log.%d{yyyy-MM-dd}</fileNamePattern>
    </rollingPolicy>
    <encoder>
      <pattern>%d{"dd-MMM-yy HH:mm:ss,SSS"}|%-5.5(%p%marker)|%-19.19c{19}|%-27.27t|%m%n</pattern>
    </encoder>
  </appender>

  <appender name="LSConsole" class="ch.qos.logback.core.ConsoleAppender">
    <!--
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>debug</level>
    </filter>
    -->
    <encoder>
      <pattern>%d{"dd.MMM.yy HH:mm:ss,SSS"} &lt;%5.5(%p%marker)&gt; %m%n</pattern>
    </encoder>
  </appender>



  <!--
    NOTE ON CUSTOM EXTENSIONS:
    You can configure custom appenders, or filters, or other extensions,
    provided that you add your own jars and/or third party jars to the
    proper ClassLoader. Look for "logging_lib_path" in the launch script.
  -->



  <!--
    The following is the base logger of all logging messages printed by
    Lightstreamer Kernel (with a few exceptions).

    Messages logged at INFO level notify major server activities,
    like session starting and ending. If these messages are enabled,
    they are also supplied to the internal MONITOR data adapter,
    together with WARN and ERROR messages.

    Messages logged at DEBUG level notify minor operations
    and all data flow inside the Server. They should not be enabled
    with production load levels.
    No useful messages are logged at TRACE level. The level is reserved
    for debug versions of the Server.

    Severe ERROR messages are logged with a "FATAL" marker; in fact, a FATAL
    level is not natively supported by logback.
    Thanks to the marker, these messages can be filtered through logback's
    MarkerFilter.
    By the factory pattern configuration, FATAL is logged instead of ERROR
    for these messages (note the tricky "%-5.5(%p%marker)" pattern).
  -->
  <logger name="LightstreamerLogger" level="INFO">
    <appender-ref ref="LSDailyRolling" />
    <!--<appender-ref ref="LSRolling" />-->
    <!--<appender-ref ref="LSConsole" />-->
    <appender-ref ref="LSProducer" />
      <!-- must be set in order to send log messages to internal MONITOR provider -->
  </logger>



  <!--
    These two loggers are used by the internal monitoring system to log
    load statistics at INFO level.
    LightstreamerMonitorText logs statistics with a human-readable syntax;
    LightstreamerMonitorTAB logs statistics with a CSV syntax.

    The frequency of the samples produced by the internal monitoring system
    is governed by the <collector_millis> configuration element.
    However, a resampling to lower frequencies can be performed, based on the
    level specified for each logger; in particular:
      at TRACE level, all samples are logged;
      at DEBUG level, one sample out of 10 is logged;
      at INFO level, one sample out of 60 is logged;
      at a higher level, no log is produced.
    The resampling behavior can be changed at runtime, by changing the level;
    however, if the level is set to ERROR on startup, the logger will be
    disabled throughout the life of the Server, regardless of further changes.

    When resampling is in place, note that, for each displayed sample, values
    that are supposed to be averaged over a timeframe still refer to the
    current sample's timeframe (based on <collector_millis>); however, values
    that are supposed to be the maximum over all timeframes refer also to the
    samples that were not displayed.
    On the other hand, delta statistics, like "new connections", are always
    collected starting from the previous logged sample.
  -->
  <logger name="LightstreamerMonitorText" level="INFO">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="LightstreamerMonitorTAB" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>



  <!--
    The following subloggers are used to separate logging messages in families
  -->

  <!-- logging of system components initialization -->
  <!-- at DEBUG level, initialization details, error details and all configuration
       settings are reported -->
  <logger name="LightstreamerLogger.init" level="INFO">
    <appender-ref ref="LSConsole" />
  </logger>

  <!-- logging of license check phase -->
  <!-- at DEBUG level, check details and error details can be found in case
       of license check failure -->
  <logger name="LightstreamerLogger.license" level="INFO">
    <appender-ref ref="LSConsole" />
  </logger>

  <!-- logging of background activities and related configuration and issues -->
  <logger name="LightstreamerLogger.kernel" level="INFO"/>

  <!-- logging of external services activity -->
  <!-- at DEBUG level, details on external services activities and configuration,
       as well as details on connectivity issues, are reported. -->
  <logger name="LightstreamerLogger.external" level="INFO" />

  <!-- logging of activity and issues in connection management -->
  <logger name="LightstreamerLogger.io" level="WARN"/>

  <!-- logging of activity and issues in TLS configuration -->
  <!-- at DEBUG level, details on the protocol and cipher suite configuration are reported -->
  <logger name="LightstreamerLogger.io.ssl" level="WARN"/>

  <!-- logging of client request dispatching -->
  <!-- at DEBUG level, request processing details are reported -->
  <!-- All log from this logger and its subloggers reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.connections" level="WARN"/>

  <!-- logging of issues related to TLS/SSL configuration and handshake management -->
  <!-- at DEBUG level, details on the cipher suites are reported -->
  <logger name="LightstreamerLogger.connections.ssl" level="WARN"/>

  <!-- logging of client request interpretation issues -->
  <!-- at WARN level, each time a request contains an unexpected HTTP header,
     which the Server refuses or ignores, a notification is reported
     that an interpretation error is possible -->
  <!-- at INFO level, details upon request refusals are reported -->
  <!-- at DEBUG level, details for all requests and responses are reported -->
  <logger name="LightstreamerLogger.connections.http" level="ERROR"/>

  <!-- logging of details for issues related to requests over WebSockets -->
  <!-- at DEBUG level, details for all requests and responses are reported -->
  <logger name="LightstreamerLogger.connections.WS" level="WARN"/>

  <!-- logging of issues related to information received via the proxy protocol,
     when enabled -->
  <!-- at DEBUG level, details of all information received are reported -->
  <logger name="LightstreamerLogger.connections.proxy" level="INFO"/>

  <!-- logging of internal web server activity; it also logs requests of
     static resources related to push requests -->
  <!-- at DEBUG level, error details are reported -->
  <!-- All log from this logger and its subloggers reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.webServer" level="WARN"/>

  <!-- logging of request management related to the JMX Tree feature -->
  <!-- at DEBUG level, error details are reported -->
  <logger name="LightstreamerLogger.webServer.jmxTree" level="WARN"/>

  <!-- logging of handling of special requests from apple clients related to MPN -->
  <!-- at DEBUG level, error details are reported -->
  <logger name="LightstreamerLogger.webServer.appleWebService" level="WARN"/>

  <!-- logging of parsing and elaboration of client requests -->
  <!-- at DEBUG level, client request details are reported -->
  <!-- All log from this logger and its subloggers reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.requests" level="INFO"/>

  <!-- logging of elaboration of client polling requests -->
  <logger name="LightstreamerLogger.requests.polling" level="WARN"/>

  <!-- logging of elaboration of client message requests -->
  <!-- at DEBUG level, details on the message forwarding are reported -->
  <logger name="LightstreamerLogger.requests.messages" level="INFO"/>

  <!-- logging of Data Adapters interactions -->
  <!-- at DEBUG level, details on subscription operations are reported -->
  <logger name="LightstreamerLogger.subscriptions" level="INFO"/>

  <!-- logging of events coming from the Data Adapters -->
  <!-- at DEBUG level, all update events are dumped -->
  <logger name="LightstreamerLogger.subscriptions.upd" level="INFO"/>

  <!-- logging of events preprocessing stage -->
  <!-- at DEBUG level, events dispatched to ItemEventBuffers are dumped -->
  <logger name="LightstreamerLogger.preprocessor" level="INFO"/>

  <!-- logging of internal thread management and events dispatching -->
  <logger name="LightstreamerLogger.scheduler" level="INFO"/>

  <!-- logging of InfoPump and ItemEventBuffers internal activity -->
  <!-- at DEBUG level, updates to be sent to the clients are dumped -->
  <logger name="LightstreamerLogger.pump" level="INFO"/>

  <!-- logging of management of messages received from the clients -->
  <!-- at DEBUG level, details of message processing are logged -->
  <!-- All log from this logger reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.pump.messages" level="INFO"/>

  <!-- logging of socket write activity -->
  <!-- at DEBUG level, all socket writes are dumped -->
  <!-- All log from this logger reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.push" level="INFO"/>

  <!-- logging of mobile push notifications activity, done through the various subloggers -->
  <logger name="LightstreamerLogger.mpn" level="INFO"/>

  <!-- logging of MPN Module recurrent activity -->
  <!-- at INFO level, main operation exit points and outcomes are dumped -->
  <!-- at DEBUG level, the various operation entry entry and exit points are logged -->
  <logger name="LightstreamerLogger.mpn.lifecycle" level="INFO"/>

  <!-- logging of mobile push notifications activity -->
  <!-- at INFO level, main operation exit points and outcomes are dumped -->
  <!-- at DEBUG level, the various operation entry entry and exit points are logged -->
  <logger name="LightstreamerLogger.mpn.operations" level="INFO"/>

  <!-- logging of mobile push notifications request processing;
       requests include those from clients (through the "client" sublogger)
       and those related with internal operations -->
  <!-- at INFO level, all request processing exit points and outcomes are dumped -->
  <!-- at DEBUG level, all request processing entry points are logged -->
  <!-- All log related with client requests reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.mpn.requests" level="WARN"/>

  <!-- logging of mobile push notifications activity related to notification gathering -->
  <!-- at INFO level, all push notifications ready to be sent are dumped -->
  <logger name="LightstreamerLogger.mpn.pump" level="WARN"/>

  <!-- logging of mobile push notifications activity related to database -->
  <!-- at DEBUG level, all database operation entry and exit points are logged -->
  <logger name="LightstreamerLogger.mpn.database" level="WARN"/>

  <!-- logging of mobile push notifications activity related to database transactions -->
  <!-- at INFO level, statistics on the database transactions are logged -->
  <!-- at DEBUG level, all database transaction entry and exit points are logged -->
  <logger name="LightstreamerLogger.mpn.database.transactions" level="WARN"/>

  <!-- logging of mobile push notifications activity related to Apple platforms;
       for activity related with notification submission, 
       specific subloggers are present for each application, e.g.:
       LightstreamerLogger.mpn.apple.com.mydomain.myapp -->
  <!-- at INFO level, all push notification payloads are dumped -->
  <logger name="LightstreamerLogger.mpn.apple" level="WARN"/>

  <!-- logging of mobile push notifications activity related to Google platforms;
       for activity related with notification submission, 
       specific subloggers are present for each application, e.g.:
       LightstreamerLogger.mpn.google.com.mydomain.myapp -->
  <!-- at INFO level, all push notification payloads are dumped -->
  <logger name="LightstreamerLogger.mpn.google" level="WARN"/>

  <!-- logging of issues related with the special adapters handled by the MPN Module -->
  <logger name="LightstreamerLogger.mpn.status_adapters" level="WARN"/>

  <!-- logging of JavaScript client messages -->
  <!-- at DEBUG level, log messages sent by the Web and Node.js (Unified API) Client Libraries
       are logged. Remote logging must be enabled on the client side. -->
  <!-- All log from this logger reports the IP and port of the involved connection -->
  <logger name="LightstreamerLogger.webclient" level="DEBUG"/>

  <!-- logging of JMX setup issues; note that full JMX features could be restricted
       depending on Edition and License Type. -->
  <!-- at DEBUG level, JMX connectors initialization details are logged. -->
  <logger name="LightstreamerLogger.monitoring" level="INFO"/>



  <!--
    The following logger logs healthcheck request processing at INFO level.
    The logger does not inherit from "LightstreamerLogger" in order
    to simplify sending the log to a dedicated appender.
    All log from this logger reports the IP and port of the involved connection.
  -->
  <logger name="LightstreamerHealthCheck" level="INFO">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <!--
    This logger is only used by the provided Proxy Data and Metadata Adapters,
    when used.
    It logs Adapter activity at INFO, WARN, ERROR and FATAL level
    (the latter through the "FATAL" marker).
    At DEBUG level, outcoming request and incoming response messages are also dumped.
    At TRACE level, incoming real-time update messages are also dumped.
  -->
  <logger name="LightstreamerProxyAdapters" level="INFO">
    <appender-ref ref="LSDailyRolling" />
    <!--<appender-ref ref="LSRolling" />-->
    <appender-ref ref="LSConsole" />
  </logger>



  <!--
    Log from third-party libraries used internally by the Server.
    All the log produced by these libraries is routed, by keeping the category names,
    to the JDK's java.util.logging system first, then routed to Logback.
    Hence, this log can be consumed by defining the loggers below.

    If any Adapter should log through the java.util.logging support
    on the same categories, (either directly, or by using the same JDK services,
    or through some third-party library), this log will be shared with the Server log.
    
    If, for any reason, it is required that the configuration of the java.util.logging
    system for some of these categories is done elsewhere, then the mappings done here
    can be disabled at startup, by just removing or commenting out the corresponding
    loggers below, or by setting them to level OFF.
    Disabling the mapping may also prevent inefficiency for heavy loggers.
  -->

  <!--
    These loggers are related to Hibernate, a component used by the MPN Module
    for its persistence with the database. In case of need, please refer to
    Hibernate documentation for more information on its logging categories and
    their configuration.
  -->
  <logger name="org.hibernate" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <logger name="java.sql" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <logger name="org.jboss.logging" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <logger name="com.zaxxer.hikari" level="INFO">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <!--
    These loggers are related to other third-party libraries used internally
    by the Server.
  -->
  <logger name="org.apache.http" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="com.github.markusbernhardt.proxy" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="org.restlet" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="org.jminix" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="common.jmx.velocity" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="com.turo" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="com.google" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="io.netty" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="org.codehaus.janino" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="io.grpc" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="io.opencensus" level="WARN">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="org.conscrypt" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <!--
    These loggers are related to JDK services.
  -->
  <logger name="javax.management.remote" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="javax.management.mbeanserver" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="com.sun.jmx.remote" level="ERROR">
    <appender-ref ref="LSDailyRolling" />
  </logger>
  <logger name="javax.net.ssl" level="OFF">
    <!-- this also requires that the JVM property javax.net.debug is set as an empty string (supported since java 9) -->
    <appender-ref ref="LSDailyRolling" />
  </logger>

  <!--
    Setting properties in the root logger is not needed, as all log
    messages fall in one of the loggers defined above.
  -->
  <root>
  </root>

</configuration>
