How To Forward Logs to Grafana Loki using Logbackappender

Hi,

you said that your application is developed with log4j, then you are talking about Logback. You can send logs to Loki using any of those so either way is fine.

What do you mean by “loki dependency” that you added to pom?

Typically you will need a dependency on a logging framework (log4j2 or Logback) and dependency on some custom appender made specially for sending logs to Loki.

To my knowledge there are two projects that can help you.

I myself have developed Tjahzi which provides a log4j2 appender as well as logback appender.
There is also Loki4j project which seems to provide a fine logback appender.

Both have extensive documentation.

1 Like