Closed RobertHeim closed 4 years ago
I use loki/promtail with Spring and Logback and it works without a logback appender. If you're running in Kubernetes, just configure your application to log to stdout then promtail will scrape the log files on that node. Even if you're not running in Kubernetes, just log to a file and configure promtail to scrape that file.
I see that promtail primarely targets these deployments (kubernetes, or file logging) but a (rather small and not critical) project running on heroku and the (junior) developers not using docker but just a fat jar would benefit from a logback appender to keep the tech stack small.
Or am I missing something on how to setup promtail to catch up on a spring log file within a heroku deployment? But even if there is a solution, I still suggest an appender to integrate with logback.
The challenges here would be incorporating the natively compiled promtail app into a java runtime, you'd need to start looking at JNI/JNA which is always treading into murky waters, especially not knowing (or controlling) what the underlying heroku runtime environment looks like.
A better solution might be writing a logback appender that pushes directly to the Loki API.
I think we can leave this issue open to get a feel for community interest, add your thumbs up to the original comment if this is something you are interested in.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Now that loki is GA. Would be awesome to have such appender.
Hello, I think that once #1275 is merged you can just use the syslog logback appender :)
I will try thanks. It might be approach.
I see the stalebot closed this issue, however I think there still would be value in a logback appender that can send directly to Loki
@adityacs it looks like you have some experience in Java and the work you started doing for the logstash plugin with jruby (minus the jruby party which we wouldn't need for a pure java solution) might be useful here?
Is this something you would be interested in working on also? I can provide some guidance on how we would like to setup the Java packaging and how to incorporate this into the project
@slim-bean Definitely, I will look into this. Just to confirm we are speaking of this logback right https://github.com/qos-ch/logback ?
Yup that's the one!
On Thu, Mar 19, 2020 at 11:21 AM Aditya C S notifications@github.com wrote:
@slim-bean https://github.com/slim-bean Definitely, I will look into this. Just to confirm we are speaking of this logback right https://github.com/qos-ch/logback ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/grafana/loki/issues/604#issuecomment-601239470, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACO2RK4RJCAJKUMMIXWRMITRIIZ53ANCNFSM4HNYUUKQ .
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Out of curiosity, what's the state for #1908 ? I'm evaluating some logging solutions and having a way to use logback directly would be a big selling point towards Loki.
Please check https://github.com/loki4j/loki-logback-appender
@nehaev unfortunately, this does not seem to work with Quarkus
Is your feature request related to a problem? Please describe. In order to integrate
Loki
with the Java and especially with the Spring Boot ecosystem we needpromtail
support for Java based loggers.Describe the solution you'd like It would be great to have a Logback Appender for
promtail
contributed to https://github.com/sndyuk/logback-more-appendersDescribe alternatives you've considered There is a fluentd appender in the
logback-more-appenders
package that could be used in combination with the providedfluent-plugin-loki
. However, it does not work due to a name conflict. I think we could fix this, but in compliance with the overall grafana strategy it could promote promtail if there is a dedicated logback appender.Additional context (none)