<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
  <Appenders>
    <Console name="STDOUT" target="SYSTEM_OUT">

      <!-- This is a JSON format that can be read by the Stackdriver Logging agent. The trace ID,
           span ID, sampling decision, and timestamp are interpreted by Stackdriver. It uses the
           special JSON keys that the Stackdriver Logging agent converts to "trace", "spanId",
           "traceSampled", and "timestamp" in the Stackdriver LogEntry
           (https://cloud.google.com/logging/docs/agent/configuration#special-fields). -->

      <JsonLayout compact="true" eventEol="true">
        <KeyValuePair key="logging.googleapis.com/trace" value="$${ctx:traceId}"/>
        <KeyValuePair key="logging.googleapis.com/spanId" value="$${ctx:spanId}"/>
        <KeyValuePair key="logging.googleapis.com/traceSampled" value="$${ctx:traceSampled}"/>
        <KeyValuePair key="time" value="$${date:yyyy-MM-dd}T$${date:HH:mm:ss.SSS}Z"/>
     </JsonLayout>

    </Console>
  </Appenders>
  <Loggers>
    <Logger name="io.grpc.netty" level="INFO"/>
    <Logger name="io.netty" level="INFO"/>
    <Logger name="sun.net" level="INFO"/>
    <Root level="TRACE">
      <AppenderRef ref="STDOUT"/>
    </Root>
  </Loggers>
</Configuration>
