Skip to content
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

WARNINGs/ERRORs output with logback 1.1.7 #160

Closed
philsttr opened this issue Apr 6, 2016 · 16 comments
Closed

WARNINGs/ERRORs output with logback 1.1.7 #160

philsttr opened this issue Apr 6, 2016 · 16 comments
Labels
type/bug-logback Bugs in logback that impact logstash-logback-encoder

Comments

@philsttr
Copy link
Collaborator

philsttr commented Apr 6, 2016

From @Martin-Wegner...

Running the following config...

    <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
      <providers>
        <timestamp>
          <fieldName>timestamp</fieldName>
        </timestamp>
        <logLevel>
          <fieldName>logLevel</fieldName>
        </logLevel>
        <threadName>
          <fieldName>threadName</fieldName>
        </threadName>
        <loggerName>
          <fieldName>loggerName</fieldName>
        </loggerName>
        <callerData>
          <classFieldName>className</classFieldName>
          <methodFieldName >methodName</methodFieldName>
          <fileFieldName>[ignore]</fileFieldName>
          <lineFieldName>lineNumber</lineFieldName>
        </callerData>
        <message />
        <stackTrace>
          <fieldName>stackTrace</fieldName>
          <throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
            <exclude>java\..*</exclude>
            <exclude>net\.sf\.cglib\..*</exclude>
            <exclude>org\.springframework\..*</exclude>
            <exclude>sun\..*</exclude>
            <maxDepthPerThrowable>30</maxDepthPerThrowable>
            <rootCauseFirst>true</rootCauseFirst>
          </throwableConverter>
        </stackTrace>
      </providers>
    </encoder>

produces the below errors with logback 1.1.7

Warning: Class 'net.logstash.logback.composite.loggingevent.LogLevelJsonProvider' contains multiple setters for the same property 'fieldNames'.
Warning: Class 'net.logstash.logback.composite.loggingevent.ThreadNameJsonProvider' contains multiple setters for the same property 'fieldNames'.
Warning: Class 'net.logstash.logback.composite.loggingevent.LoggerNameJsonProvider' contains multiple setters for the same property 'fieldNames'.
Warning: Class 'net.logstash.logback.composite.loggingevent.CallerDataJsonProvider' contains multiple setters for the same property 'fieldNames'.
Warning: Class 'net.logstash.logback.composite.loggingevent.MessageJsonProvider' contains multiple setters for the same property 'fieldNames'.
Warning: Class 'net.logstash.logback.composite.loggingevent.StackTraceJsonProvider' contains multiple setters for the same property 'fieldNames'.
20:50:41,230 |-ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION
20:50:41,230 |-ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION
20:50:41,231 |-ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION
20:50:41,231 |-ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION

Running the same configuration using logback 1.1.6 does not produce these warnings/errors

@philsttr
Copy link
Collaborator Author

philsttr commented Apr 6, 2016

This error:

0:50:41,230 |-ERROR in ch.qos.logback.core.joran.action.NestedBasicPropertyIA - Unexpected aggregationType AS_BASIC_PROPERTY_COLLECTION

was introduced in logback 1.1.7, and appears to be the same as LOGBACK-1158, which has been fixed for logback 1.1.8 (not released yet)

@philsttr
Copy link
Collaborator Author

philsttr commented Apr 6, 2016

These errors:

Warning: Class 'net.logstash.logback.composite.loggingevent.LogLevelJsonProvider' contains multiple setters for the same property 'fieldNames'.

are caused by LOGBACK-1164, also introduced in logback 1.1.7.

Hopefully this will get fixed in logback 1.1.8

@philsttr
Copy link
Collaborator Author

philsttr commented Apr 6, 2016

Until these errors are fixed in logback, I can only recommend using logback 1.1.6

@philsttr philsttr added the type/bug-logback Bugs in logback that impact logstash-logback-encoder label Apr 6, 2016
@Martin-Luft
Copy link

OK thanks :)

@GuiSim
Copy link
Contributor

GuiSim commented Oct 21, 2016

I wish we could use this appender with logback 1.1.7.

Does anyone have a workaround that doesn't require rolling back to 1.1.6?

@Martin-Luft
Copy link

It looks like that logback is dead because of no activitiy since May :(

@lkwg82
Copy link

lkwg82 commented Oct 26, 2016

@Martin-Wegner Time to fork? Maybe get in contact with the maintainers to offer help.

@Martin-Luft
Copy link

No commits since 12th May 2016 https://github.com/qos-ch/logback/commits/master :(

Latest resolved issue 13th May 2016 http://jira.qos.ch/projects/LOGBACK :(

No reaction to my comment Any news on this issue? Since May 12 no commits in the GIT repository. Is logback dead? http://jira.qos.ch/browse/LOGBACK-1164 :(

@lkwg82 a fork, hmmm, or use an alternative like log4j2? Contact with the maintainers? The only assignee I can see is Ceki Gulcu and the only commiter I can see is @ceki, so a 1 person project and no maintainers??? :/

@SchwingSK
Copy link

Just a note: it's not dead, Ceki resumed commits on 4th November 2016. No news on http://jira.qos.ch/browse/LOGBACK-1164 yet though.

@DJPillowhead
Copy link

DJPillowhead commented Nov 8, 2016

It seems that the bug is fixed here:
commit/2ba396a20e44d2f
but won't be rolled out until 1.1.8 comes out.

@ljohnny
Copy link

ljohnny commented Dec 8, 2016

boot 1.4.0,cloud Camden.SR2 .
the logback 1.1.7 rolling back to 1.1.6, it's work.

@Stephan202
Copy link

Just upgraded to Logback 1.1.8. Can confirm that resolves the issue.

@Martin-Luft
Copy link

My warnings are all fixed in 1.1.8 :)

@lkwg82
Copy link

lkwg82 commented Dec 16, 2016

this can be closed

@qixiaobo
Copy link

qixiaobo commented May 3, 2017

public void body(InterpretationContext ec, String body) {

        String finalBody = ec.subst(body);
        // get the action data object pushed in isApplicable() method call
        IADataForBasicProperty actionData = (IADataForBasicProperty) actionDataStack.peek();
        switch (actionData.aggregationType) {
        case AS_BASIC_PROPERTY:
            actionData.parentBean.setProperty(actionData.propertyName, finalBody);
            break;
        case AS_BASIC_PROPERTY_COLLECTION:
            actionData.parentBean.addBasicProperty(actionData.propertyName, finalBody);
        default:
            addError("Unexpected aggregationType " + actionData.aggregationType);
        }
    }

Sorry for forget break

@lkwg82
Copy link

lkwg82 commented May 3, 2017

https://sonarqube.com/about could help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug-logback Bugs in logback that impact logstash-logback-encoder
Projects
None yet
Development

No branches or pull requests

9 participants