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

GelfHttpAppender does not set Uri #103

Closed
formatq opened this issue Apr 10, 2024 · 1 comment
Closed

GelfHttpAppender does not set Uri #103

formatq opened this issue Apr 10, 2024 · 1 comment
Labels

Comments

@formatq
Copy link

formatq commented Apr 10, 2024

Describe the bug
GEtting error:
ERROR in de.siegmar.logbackgelf.GelfHttpAppender[GELF] - URI is required
even if uri field has correct uri like http://localhost:33002/gelf.

The field insecure is changed to true correctly.

To Reproduce
Try to use configuration like:

`

    <uri>http://localhost:33002/gelf</uri>
    <insecure>true</insecure>

    <encoder class="de.siegmar.logbackgelf.GelfEncoder">
        <includeRawMessage>false</includeRawMessage>
        <includeMarker>true</includeMarker>
        <includeMdcData>true</includeMdcData>
        <includeCallerData>false</includeCallerData>
        <includeRootCauseData>false</includeRootCauseData>
        <includeLevelName>true</includeLevelName>
        <appendNewline>true</appendNewline>
        <shortPatternLayout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%m%nopex</pattern>
        </shortPatternLayout>
        <fullPatternLayout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%n</pattern>
        </fullPatternLayout>
    </encoder>
</appender>

`

Additional context

  • Java distribution and version in use (output of java -version):
    17

  • SLF4J and Logback version in use:
    1.5.3

  • Some my investigation
    I did some debug and found that method ch.qos.logback.core.joran.util.AggregationAssessor#getDefaultClassNameByAnnonation tries to read DefaultClass annotation to pick correct Java Class for the path string, but looks like class GelfHttpAppender does not have it.

Sorry for messy report. Hope it's helps you some how.

@osiegmar
Copy link
Owner

Thanks for pointing out!

@osiegmar osiegmar added the bug label Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants