-
Establish (via tests) how the
net.logstash.logback.encoder.LogstashEncoder
behaves with various different types ofMarker
payload, includingbyte[]
,Enumeration
,Optional
,BigInteger
,BigDecimal
,Stream
,Iterator
,Iterable
, etc. For example:import static org.test.OurMarkers.append; LogstashMarker m = append("Bytes", "གུ་གེ་ཚེ་རིང་རྒྱལ་པོ་".getBytes(Charsets.UTF_8)); assertThat( markerToString(m) ).contains("\"Bytes\":\"གུ་གེ་ཚེ་རིང་རྒྱལ་པོ་\""); ... Enumeration<String> e = new Vector<>(Arrays.asList("製品に関する重要なお知らせ", "b", "c")).elements(); LogstashMarker m = append("Enum", e); assertThat( markerToString(m) ).contains("\"Enum\":[\"製品に関する重要なお知らせ\",\"b\",\"c\"]"); ... assertThat( markerToString( append("Opt", Optional.of("hello")) ) ).contains("\"Opt\":\"hello\""); assertThat( markerToString( append("Opt", Optional.empty()) ) ).contains("\"Opt\":\"<missing>\"");
-
Demonstrate a (hopefully) more helpful API for joining multiple
Marker
s for a SLF4J log event. For example:import org.apache.commons.lang3.tuple.Pair; import static org.test.OurMarkers.with; ... logger.info( with(marker1, marker2, marker3), "event"); logger.info( with( Pair.of("a","b"), Pair.of("c","d")), "event");
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
poblish/logback-encoder-test
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Demonstrate a more capable ObjectAppendingMarker and Marker-builder API
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published