Hi,
I have a Spring Boot 3.4 app with enabled logging.structured.format.file=ecs
I would like to know how to ingest those logs into Loki?
I was not able to find any docs about the subject.
Thanks in advance
welcome @yev4
are the log files persisted to disk? please share a sample log be it json or stand log line type
Yes, the log files can be persisted to disk.
Here the example of json:
{"@timestamp":"2025-03-06T10:15:20.651835Z","log.level":"DEBUG","process.pid":45454,"process.thread.name":"http-nio-8080-exec-8","service.name":"todo microservice","log.logger":"org.springframework.web.servlet.DispatcherServlet","message":"Completed 200 OK","ecs.version":"8.11"}
{"@timestamp":"2025-03-06T10:15:26.460270Z","log.level":"DEBUG","process.pid":45454,"process.thread.name":"SIGINT handler","service.name":"todo microservice","log.logger":"java.lang.Runtime","message":"Runtime.exit() called with status: 130","error.type":"java.lang.Throwable","error.message":"Runtime.exit(130)","error.stack_trace":"java.lang.Throwable: Runtime.exit(130)\n\tat java.base\/java.lang.Shutdown.logRuntimeExit(Shutdown.java:179)\n\tat java.base\/java.lang.Shutdown.exit(Shutdown.java:160)\n\tat java.base\/java.lang.Terminator$1.handle(Terminator.java:51)\n\tat java.base\/jdk.internal.misc.Signal$1.run(Signal.java:218)\n\tat java.base\/java.lang.Thread.run(Thread.java:1575)\n","ecs.version":"8.11"}