Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamen Pyle benbpyle

View GitHub Profile
View logstash-tcp.conf
input {
tcp {
port => "5000"
codec => json_lines
}
}
output {
stdout {}
}
View logback-tcp.xml
<?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>
@benbpyle
benbpyle / logging-example.java
Created Mar 23, 2019
SLF4J logging example
View logging-example.java
package com.logging-example
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/logging-example")
You can’t perform that action at this time.