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

Have logstash-logback-encoder send logs directly to elasticsearch backend #994

Open
patpatpat123 opened this issue Nov 20, 2023 · 0 comments

Comments

@patpatpat123
Copy link

Is your feature request related to a problem? Please describe.
This project is amazing.
With simple configuration, like this one below, one can very easily forward logs to logstash, and have logstash forward the logs to elasticsearch.

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">

    <springProperty scope="context" name="name" source="spring.application.name"/>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} ${PID} %-5level --- [%thread] [${name},%X{traceId:-},%X{spanId:-}] %logger{36} : %msg%n
            </pattern>
        </encoder>
    </appender>

    <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
        <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
        <destination>mylogstash:5555</destination>
    </appender>

    <root level="INFO">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="LOGSTASH"/>
    </root>

</configuration>

Unfortunately, this requires to spin up and maintain an entire logstash instance, just for the sake of forwarding those logs.

Describe the solution you'd like

it would be great if this project can send to elasticsearch directly, something like

    <appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
        <encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
        <destination>myelasticsearch:9092/thelogindex</destination>
    </appender>

This would make this project even more awesome

Thank you for your consideration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants