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

Unintended Label Show On Loki Log #129

Closed
wusunny2022 opened this issue Nov 5, 2024 · 2 comments
Closed

Unintended Label Show On Loki Log #129

wusunny2022 opened this issue Nov 5, 2024 · 2 comments

Comments

@wusunny2022
Copy link

Description:
First, appreciate the effort of the plugin's integration with Loki. I have included my log4j2.xml configuration below, but I've noticed that two unintended labels, detected_level and service_name, are appearing in the log entries. Are these labels set by default? I would like to have control over the labels included in the logs. Thank you!
image

<Configuration status="WARN" monitorInterval="30" packages="pl.tkowalcz.tjahzi.log4j2">

    <Properties>
        <Property name="LOG_DATEFORMAT_PATTERN">%d{yyyy-MM-dd HH:mm:ss.SSS}{GMT+8}</Property>
        <Property name="LOKI_LOG_PATTERN">message=%m level=%-5p class=%c thread=%t reqId=%X{reqId}</Property>
        <Property name="appName">springboot-core</Property>
    </Properties>

    <Appenders>
        <Loki name="loki" bufferSizeMegabytes="64">
            <url>http://localhost:3100/loki/api/v1/push</url>

            <Label name="serviceName" value="${appName}"/>
            <Label name="env" value="local"/>

            <PatternLayout>
                <Pattern>${LOKI_LOG_PATTERN}</Pattern>
            </PatternLayout>
        </Loki>
    </Appenders>

    <Loggers>
        <Root level="info">
            <AppenderRef ref="loki"/>
        </Root>
    </Loggers>
</Configuration>```
@wusunny2022
Copy link
Author

I found that it is loki internal setting, it is not relevant to the framework

@tkowalcz
Copy link
Owner

Thanks for investigating, sorry I did not have time to help you this time.

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

No branches or pull requests

2 participants