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

Added isIncludeContext check to access logger encoder. #393

Merged
merged 1 commit into from
Mar 4, 2020
Merged

Added isIncludeContext check to access logger encoder. #393

merged 1 commit into from
Mar 4, 2020

Conversation

kersten
Copy link
Contributor

@kersten kersten commented Mar 3, 2020

This PR adds the same functionality to the access logger that is already implemented in the standard JSON logger.

If one set the element includeContext to false the context of the logger is not added to the JSON output.

<configuration>
    <!-- always a good activate OnConsoleStatusListener -->
    <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="net.logstash.logback.encoder.LogstashAccessEncoder">
            <timeZone>UTC</timeZone>
            <includeContext>false</includeContext>
            <fieldNames>
                <requestHeaders>request_headers</requestHeaders>
                <responseHeaders>response_headers</responseHeaders>
            </fieldNames>
        </encoder>
    </appender>
    <appender-ref ref="STDOUT"/>
</configuration>

@philsttr philsttr merged commit 348d76e into logfellow:master Mar 4, 2020
@philsttr
Copy link
Collaborator

philsttr commented Mar 4, 2020

Thanks!!

@philsttr philsttr added this to the 6.4 milestone Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants