loki4j / loki-logback-appender

Fast and lightweight implementation of Logback appender for Grafana Loki
https://loki4j.github.io/loki-logback-appender/
BSD 2-Clause "Simplified" License
314 stars 27 forks source link

Add support for URIs with underscore #217

Closed muedsa closed 9 months ago

muedsa commented 9 months ago

Java.net.URI unsupported hostname with underscore Example: http://project_loki:3100/loki/api/v1/push, get a error Caused by: java.lang.IllegalArgumentException: unsupported URI http://snapshot_loki:3100/loki/api/v1/push Aslo see: https://github.com/spring-projects/spring-framework/issues/24439

muedsa commented 9 months ago

resolved with ApacheHttpSender https://loki4j.github.io/loki-logback-appender/docs/apacheclient

<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
    <http class="com.github.loki4j.logback.ApacheHttpSender">
        ...
    </http>
</appender>