Skip to content

Instantly share code, notes, and snippets.

@benbpyle
Created March 23, 2019 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benbpyle/e6ba544349b5fa1ee78dc054a0fd9142 to your computer and use it in GitHub Desktop.
Save benbpyle/e6ba544349b5fa1ee78dc054a0fd9142 to your computer and use it in GitHub Desktop.
Logback-TCP
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%green(%d{yyyy-MM-dd HH:mm:ss}) %magenta([%thread]) %blue(%-5level) %yellow(%logger{36}) - %msg%n
</Pattern>
</layout>
</appender>
<appender name="STASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
<destination>YOUR-IP:PORT</destination>
<!-- encoder is required -->
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
<keepAliveDuration>5 minutes</keepAliveDuration>
</appender>
<logger name="org.hibernate" level="TRACE">
<appender-ref ref="STASH"/>
</logger>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="STASH"/>
</root>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment