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

Logs are printed in console, but not getting pushed to Splunk Server #286

Open
VinayakJamadar opened this issue Apr 3, 2024 · 1 comment

Comments

@VinayakJamadar
Copy link

VinayakJamadar commented Apr 3, 2024

Logs are printed correctly in console, but not getting pushed to Splunk Server.

And not even printing any error.

Below is my log4j2.xml configuration file

<?xml version="1.0" encoding="UTF-8"?> <Configuration status="info" name="example" packages="org.example"> <Appenders> <Console name="console" target="SYSTEM_OUT"> <PatternLayout pattern="%style{%d{ISO8601}} %highlight{%-5level }[%style{%t}{bright,blue}] %style{%C{10}}{bright,yellow}: %msg%n%throwable" /> </Console> <File name="MyFile" fileName="logs/app.log"> <PatternLayout> <Pattern>%d %p %c{1.} [%t] %m%n</Pattern> </PatternLayout> </File> <SplunkHttp name="httpconf" url="http://localhost:8088" token="b489e167-d96d-46ec-922f-6b25fc83f199" host="localhost" index="spring_dev" source="source name" sourcetype="log4j" messageFormat="text" disableCertificateValidation="true"> <PatternLayout pattern="%m" /> </SplunkHttp> </Appenders>

<Loggers>
    <Root level="info">
        <AppenderRef ref="console" />
        <AppenderRef ref="MyFile"/>
        <AppenderRef ref="httpconf" />
    </Root>
</Loggers>
@underhill
Copy link

I'm seeing the same problem. Logs print to console and written to file but nothing in Splunk. I fired up tcpdump and can see packets going to the HEC endpoint. The heavy forwarder shows no errors and nothing in the index. Also verified HEC is working with curl.
Using log4j v2.33.1 and splunk javalogging 1.11.8.

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