LogstashSocketAppender prefix example incorrect
See original GitHub issueI have tried using the example given in the README with my SpringBoot (1.3.2) app
<configuration>
<conversionRule conversionWord="syslogStart" converterClass="ch.qos.logback.classic.pattern.SyslogStartConverter"/>
<appender name="stash" class="net.logstash.logback.appender.LogstashSocketAppender">
<host>127.0.0.1</host>
<port>514</port>
<prefix class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%syslogStart{LOCAL5}</pattern>
</layout>
</prefix>
</appender>
...
</configuration>
but this results in an error
Application startup failed
java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.core.joran.util.PropertySetter@10d307f1 - A "ch.qos.logback.core.encoder.LayoutWrappingEncoder" object is not assignable to a "ch.qos.logback.core.Layout" variable.
ERROR in ch.qos.logback.core.joran.util.PropertySetter@10d307f1 - The class "ch.qos.logback.core.Layout" was loaded by
ERROR in ch.qos.logback.core.joran.util.PropertySetter@10d307f1 - [sun.misc.Launcher$AppClassLoader@73d16e93] whereas object of type
ERROR in ch.qos.logback.core.joran.util.PropertySetter@10d307f1 - "ch.qos.logback.core.encoder.LayoutWrappingEncoder" was loaded by [sun.misc.Launcher$AppClassLoader@73d16e93].
but if I remove the wrapping LayoutWrappingEncoder the code works.
<appender name="JSON_SYSLOG" class="net.logstash.logback.appender.LogstashSocketAppender">
<host>127.0.0.1</host>
<port>514</port>
<prefix class="ch.qos.logback.classic.PatternLayout">
<pattern>%syslogStart{LOCAL5}</pattern>
</prefix>
</appender>
so I assume this example is incorrect.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
LogstashSocketAppender prefix example incorrect · Issue #158
I have tried using the example given in the README with my SpringBoot (1.3.2) app. ... LogstashSocketAppender prefix example incorrect #158.
Read more >logback logstash encoder Syslog header not set
After a lot of head scratching it looks like it's an issue with the wrapping LayoutWrappingEncoder part of the example.
Read more >Incorrect Prefixes and Suffixes - Nool - Ontario Tech University
Incorrect: The other team is so strong that our team is at an unadvantage. Correct: The other team is so strong that our...
Read more >WORD PARTS: MOST COMMONLY USED PREFIXES
WORD PARTS: MOST COMMONLY USED PREFIXES. PREFIX. MEANING. EXAMPLE a (or ab) without or not amoral, abnormal ab away, from abhor, absent.
Read more >Prefixes for English Language Learners - Yuba College
by part of speech, prefixes can attach to almost any word (for example, you'll see co- listed below as a prefix for verbs,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @onema,
Unfortunately, you’re running into a backwards incompatibility introduced in logback (LOGBACK-1326), as mentioned in logstash-logback-encoder #232.
I have submitted logback PR#383 to address this problem, but it has not gotten any attention in over a year (ping @ceki).
Please help out by voting for LOGBACK-1326 and adding a thumbs up to PR#383 to try to get this addressed in logback.
In the meantime, the only solution to get this working would be to downgrade logback-classic and logback-core to 1.2.0 (before the backwards incompatibility was introduced)
As @philsttr said, going to downgrade the version of logback-classic and logback-core to 1.2.0 is an excellent but unique solution at this moment. Trying to verify if these two dependencies have been added in the pom.xml is also important. Anyway, thanks for @philsttr . 💪