-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage of prefix with LogstashEncoder and LayoutWrappingEncoder throws errors #232
Comments
Hi Nuruddin, Can you please provide your complete logback.xml file (while masking any sensitive data)? Specifically, I need to see the appender element. |
Sorry for the delay. Here is my appender:
|
Looks like this is caused by a backwards incompatible change introduced in logback 1.2.1. Specifically, this change For now, you can workaround this by using logback prior to 1.2.1. I tested your config using logback 1.2.0 and 1.1.7, and it worked in both cases. |
…Appender`. This allow `LayoutWrappingEncoder` to be used within another `Encoder`. The introduction of `setParent(Appender)` in logback 1.2.1 caused an issue in downstream projects that allow a `LayoutWrappingEncoder` to be used within another `Encoder`. Specifically: logfellow/logstash-logback-encoder#232
Submitted LOGBACK-1326 with qos-ch/logback#383 to hopefully fix this in logback. |
Thank you! |
… 1.2.1+ See #232, [LOGBACK-1326](https://jira.qos.ch/browse/LOGBACK-1326) and logback [PR#383](qos-ch/logback#383)
this does not look to be resolved in any foreseeable time - is there any other way this could be fixed? |
According to this comment, @ceki has marked LOGBACK-1326 to be fixed in logback 1.3.0-alpha5. And it looks like he has been active recently in the logback repo, so hopefully, this will be addressed soon. I know 2 years is a long time to wait for a PR to be merged, but I'm still hopeful due to the recent activity. Without the requested change in logback, the only workaround would be to copy the |
Logback introduced a backwards incompatible change in 1.2.1 which will be fixed in 1.3.0 See this issue for context: logfellow/logstash-logback-encoder#232 In the meantime, we should not upgrade to any of the 1.2.x versions. #182 should be closed.
LOGBACK-1326 has been fixed in logback 1.2.5 |
I am trying to send my application logs to syslog using LogstashTcpSocketAppender. My configuration is as follows:
127.0.0.1:514 30 second 5 minutes 16384However, I get the following errors when I startup my web application.
09:21:48,936 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback-test.xml] at [file:/home/nhakimjee/work/Workspaces/syslog/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/bap/WEB-INF/classes/logback-test.xml]
09:21:49,001 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
09:21:49,002 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word syslogStart with class [ch.qos.logback.classic.pattern.SyslogStartConverter]
09:21:49,002 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [net.logstash.logback.appender.LogstashTcpSocketAppender]
09:21:49,028 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [stash-tcp]
09:21:49,358 |-ERROR in ch.qos.logback.core.joran.util.PropertySetter@5475d1b2 - A "net.logstash.logback.encoder.LogstashEncoder" object is not assignable to a "ch.qos.logback.core.Appender" variable.
09:21:49,358 |-ERROR in ch.qos.logback.core.joran.util.PropertySetter@5475d1b2 - The class "ch.qos.logback.core.Appender" was loaded by
09:21:49,359 |-ERROR in ch.qos.logback.core.joran.util.PropertySetter@5475d1b2 - [WebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@2f92e0f4
] whereas object of type
09:21:49,359 |-ERROR in ch.qos.logback.core.joran.util.PropertySetter@5475d1b2 - "net.logstash.logback.encoder.LogstashEncoder" was loaded by [WebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@2f92e0f4
].
09:21:49,359 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [net.logstash.logback.fieldnames.LogstashFieldNames] for [fieldNames] property
I used the examples to for the above configuration, am I missing some something?
Thanks,
Nuruddin
The text was updated successfully, but these errors were encountered: