Replies: 1 comment
-
Hi again, I have meanwhile approached my challenge by trying to create a “bridge” between those parts which have in my initial attempts raised ClassCastExceptions. When I attach the result of my attempts based on all latest-released versions here, The also-included file logback-access.xml shows a way by which those “bridge” classes can be configured in a way that apparently really some access logging output reaches the Loki server. It seems to work for the moment, but I think this solution is not very good, as it seems quite fragile against future library updates. Maybe I should not call it “bridge” but rather “quirk”. Nevertheless it would be great if this might help in maybe finding a better approach by which the goal (to get access logs into Loki) can be reached…? Regards |
Beta Was this translation helpful? Give feedback.
-
Hi,
in struggling with getting loki-logback-appender to work with logback-access, I have been wondering whether I am the only person trying this / being interested in this: "Directly" pushing access logs of an embedded Tomcat server into the Loki store.
Without having made a lot of attempts and analyses yet, I suppose the main problem is that...
ch.qos.logback.classic.PatternLayout extends ch.qos.logback.core.pattern.PatternLayoutBase<ILoggingEvent>
ch.qos.logback.access.common.PatternLayout extends ch.qos.logback.core.pattern.PatternLayoutBase<IAccessEvent>
But the classes of loki-logback-appender appear to expect ch.qos.logback.classic.PatternLayout, so the class hierarchy does not seem to fit together (=>ClassCastException).
We do have a working solution for all kinds of logging (and including access logging via logback-access) into the Elk Stack by making use of Logstash, and we have been requested to push the same into Loki, too (and when/if/once it works well enough, "they" will consider to get rid of the Elk Stack). So as long as I am / we are the only one(s) tying this, we might also try out the Grafana Loki Logstash Plugin with our team and whether we can reuse most of our existing logstash-logback-encoder configuration with it.
But if anyone else has been trying logback-accesss logging with loki-logback-appender, too, and maybe you have been more successful with it or have any idea how the (assumed) problems might be overcome, I would be glad to take your advice.
As might be known, logback-accesss has just recently made a major version jump after its separation from the main logback project, so it would be my/our goal to use the newer version 2.x of logback-accesss in the long term, but ideas to gain certain short-term progress with its older version 1.4.x would be appreciated, too.
Or would it take a feature request, needing explicit support for logback-access in loki-logback-appender? (Which probably takes back to the question whether I would be the only one or whether there would be others interested in it, too?)
Many thanks in advance,
Roland
Beta Was this translation helpful? Give feedback.
All reactions