Replace logback w. slf4j-simple to reduce size.

This commit is contained in:
Mark Nellemann 2021-01-05 15:07:26 +01:00
parent 7e8f49edbb
commit c20137db35
5 changed files with 26 additions and 6 deletions

View file

@ -12,10 +12,10 @@ repositories {
}
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.5.2'
implementation 'info.picocli:picocli:4.5.2'
implementation 'org.slf4j:slf4j-api:1.7.+'
runtimeOnly 'ch.qos.logback:logback-classic:1.+'
annotationProcessor 'info.picocli:picocli-codegen:4.6.0'
implementation 'info.picocli:picocli:4.6.0'
implementation 'org.slf4j:slf4j-api:1.7.30'
runtimeOnly 'org.slf4j:slf4j-simple:1.7.30'
testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0')
testImplementation("org.slf4j:slf4j-simple:1.7.+")
@ -74,3 +74,6 @@ jar {
)
}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

View file

@ -1,3 +1,3 @@
id = syslogd
group = biz.nellemann.syslogd
version = 1.0.6
version = 1.0.7

View file

@ -21,7 +21,6 @@ import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class TcpServer {

View file

@ -0,0 +1,4 @@
org.slf4j.simpleLogger.showDateTime=true
org.slf4j.simpleLogger.showShortLogName=true
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss.SSS
org.slf4j.simpleLogger.levelInBrackets=true

View file

@ -32,6 +32,20 @@ class SyslogParserTest extends Specification {
msg.application == "padmin"
}
void "test another rfc3164 aix/vios message"() {
setup:
def input = "<13>Dec 18 10:09:22 Message forwarded from p924vio1: root: [errnotify] seq: 24266 - AA8AB241 1218100920 T O OPERATOR OPERATOR NOTIFICATION"
when:
SyslogMessage msg = SyslogParser.parseRfc3164(input)
then:
msg.message == "[errnotify] seq: 24266 - AA8AB241 1218100920 T O OPERATOR OPERATOR NOTIFICATION"
msg.hostname == "p924vio1"
msg.application == "root"
}
void "test rfc3164 normal message"() {
setup: