-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #TG-377 feat: added logback.xml (#1736)
- Loading branch information
AMIT KUMAR
authored
Jul 17, 2020
1 parent
2d51cbb
commit 9d08bcb
Showing
3 changed files
with
106 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
ansible/roles/stack-sunbird/templates/learner-service_logback.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<configuration> | ||
|
||
<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" /> | ||
|
||
<!-- transaction-event-trigger START --> | ||
<timestamp key="timestamp" datePattern="yyyy-MM-dd"/> | ||
<!-- common transactions logs --> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<appender name="ASYNCSTDOUT" class="ch.qos.logback.classic.AsyncAppender"> | ||
<appender-ref ref="STDOUT" /> | ||
</appender> | ||
|
||
|
||
<logger name="play" level="INFO" /> | ||
<logger name="DefaultPlatformLogger" level="INFO" /> | ||
<!-- Telemetry Loggers--> | ||
|
||
<root level="INFO"> | ||
<appender-ref ref="ASYNCSTDOUT" /> | ||
</root> | ||
|
||
|
||
<appender name="kafka-appender" class="com.github.danielwegener.logback.kafka.KafkaAppender"> | ||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
<pattern>%msg</pattern> | ||
</encoder> | ||
|
||
<topic>${ENV_NAME}.telemetry.raw</topic> | ||
<!-- ensure that every message sent by the executing host is partitioned to the same partition strategy --> | ||
<keyingStrategy class="com.github.danielwegener.logback.kafka.keying.NoKeyKeyingStrategy" /> | ||
<!-- block the logging application thread if the kafka appender cannot keep up with sending the log messages --> | ||
<deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" /> | ||
|
||
<!-- each <producerConfig> translates to regular kafka-client config (format: key=value) --> | ||
<!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs --> | ||
<!-- bootstrap.servers is the only mandatory producerConfig --> | ||
<producerConfig>bootstrap.servers=${SUNBIRD_KAFKA_URL}</producerConfig> | ||
<!-- don't wait for a broker to ack the reception of a batch. --> | ||
<producerConfig>acks=0</producerConfig> | ||
<!-- wait up to 1000ms and collect log messages before sending them as a batch --> | ||
<producerConfig>linger.ms=15000</producerConfig> | ||
<!-- even if the producer buffer runs full, do not block the application but start to drop messages --> | ||
<producerConfig>max.block.ms=0</producerConfig> | ||
<!-- define a client-id that you use to identify yourself against the kafka broker --> | ||
<producerConfig>client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed</producerConfig> | ||
|
||
<!-- there is no fallback <appender-ref>. If this appender cannot deliver, it will drop its messages. --> | ||
|
||
</appender> | ||
|
||
<appender name="context-log-kafka-appender" class="com.github.danielwegener.logback.kafka.KafkaAppender"> | ||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | ||
<pattern>%msg</pattern> | ||
</encoder> | ||
|
||
<topic>${ENV_NAME}.db.query.events</topic> | ||
<!-- ensure that every message sent by the executing host is partitioned to the same partition strategy --> | ||
<keyingStrategy class="com.github.danielwegener.logback.kafka.keying.NoKeyKeyingStrategy" /> | ||
<!-- block the logging application thread if the kafka appender cannot keep up with sending the log messages --> | ||
<deliveryStrategy class="com.github.danielwegener.logback.kafka.delivery.AsynchronousDeliveryStrategy" /> | ||
|
||
<!-- each <producerConfig> translates to regular kafka-client config (format: key=value) --> | ||
<!-- producer configs are documented here: https://kafka.apache.org/documentation.html#newproducerconfigs --> | ||
<!-- bootstrap.servers is the only mandatory producerConfig --> | ||
<producerConfig>bootstrap.servers=${SUNBIRD_KAFKA_URL}</producerConfig> | ||
<!-- don't wait for a broker to ack the reception of a batch. --> | ||
<producerConfig>acks=0</producerConfig> | ||
<!-- wait up to 1000ms and collect log messages before sending them as a batch --> | ||
<producerConfig>linger.ms=15000</producerConfig> | ||
<!-- even if the producer buffer runs full, do not block the application but start to drop messages --> | ||
<producerConfig>max.block.ms=0</producerConfig> | ||
<!-- define a client-id that you use to identify yourself against the kafka broker --> | ||
<producerConfig>client.id=${HOSTNAME}-${CONTEXT_NAME}-logback-relaxed</producerConfig> | ||
|
||
<!-- there is no fallback <appender-ref>. If this appender cannot deliver, it will drop its messages. --> | ||
|
||
</appender> | ||
|
||
<logger name="TelemetryEventLogger" level="INFO"> | ||
<appender-ref ref="kafka-appender" /> | ||
</logger> | ||
|
||
<logger name="ContextEventLogger" level="DEBUG"> | ||
<appender-ref ref="context-log-kafka-appender" /> | ||
</logger> | ||
|
||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters