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

16:05:31,686 |-ERROR in com.github.loki4j.client.pipeline.DefaultPipeline@7e0c6f86 - Loki responded with non-success status 405 on batch #49164a08c588 (3.123 bytes). Error: #168

Closed ranob closed 1 year ago

ranob commented 1 year ago

When I use loki appender from a simple spring boot demo example I get this error:

16:05:31,686 |-ERROR in com.github.loki4j.client.pipeline.DefaultPipeline@7e0c6f86 - Loki responded with non-success status 405 on batch #49164a08c588 (3.123 bytes). Error:

I am using grafana cloud loki instance. ¿Any idea?

Regards, Alberto

nehaev commented 1 year ago

Hi @ranob, thanks for reporting!

Based on this description it's hard to say what is really happening. Could you help me to investigate this issue?

  1. Is error message indeed empty or you didn't paste it here?
  2. What format do you use: json or protobuf?
  3. Is this issue associated with some particular characters/log lines? Could you isolate them and check if they cause the issue?
  4. Any other relevant details you can provide
ranob commented 1 year ago

Hello,

I have changed the URL parameter and now the 405 status error is not showed. But still, I cannot see any logs at loki. If I change the password I get an autentication error. This is my configuration:

image

and this is the output.

image

Is there any way to enable some log for loki plugin in to see what is doing inside?

I am also attaching the demo maven project I am testing with.

Thank you and Regards, Alberto

demo-2.zip

nehaev commented 1 year ago

The right URL should end with /loki/api/v1/push. The one that you use now is deprecated by Loki and not supported in Loki4j.

Your message pattern looks fancy. Could you first check something simpler, e.g. %level %msg %ex?

You can enable debug logging to stderr by setting <verbose>true</verbose> in appender config.

nehaev commented 1 year ago

So far it looks like a configuration issue on your side. Fill free to re-open if there would be something I can reproduce and fix.

ranob commented 1 year ago

I don´t know but now it´s working. Thank you!