Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bc7f6c378 | ||
|
|
489e7b1233 |
@@ -17,5 +17,5 @@ target: 2196 physical lines, 1524 events, 0 orphan lines
|
|||||||
that ERROR event: level=ERROR logger=HikariPool continuation lines=3
|
that ERROR event: level=ERROR logger=HikariPool continuation lines=3
|
||||||
exception line: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
|
exception line: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30000ms.
|
||||||
|
|
||||||
## The same line without the application name bracket
|
## The same line without the application name (Spring Boot before 3.4)
|
||||||
parsed: level=INFO thread=nio-8080-exec-1 logger=OrderController message=Order 42 placed
|
parsed: level=INFO thread=nio-8080-exec-1 logger=OrderController message=Order 42 placed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# The embedder is a seam: a remote one behind a stub /v1/embeddings
|
# The embedder is a seam: a remote one behind a stub /v1/embeddings
|
||||||
embedder: openai-compatible:stub-model, dimensions: 32
|
embedder: openai-compatible:stub-model, dimensions: 32
|
||||||
HTTP requests while fitting 10 baseline templates: 2
|
HTTP requests while fitting 10 baseline templates: 2
|
||||||
first request body: {"model":"stub-model","input":["INFO CatalogController GET /api/products/<*> <*> in <*> ms","INFO AuthFilter Token validated for user u-<*>","INFO Ord...
|
first request body: {"input":["INFO CatalogController GET /api/products/<*> <*> in <*> ms","INFO AuthFilter Token validated for user u-<*>","INFO OrderController Order <*...
|
||||||
distance of the pool-timeout template through the stub: 0.520
|
distance of the pool-timeout template through the stub: 0.520
|
||||||
The stub returns the hashing embedder's own vectors, so this shows the plumbing and says nothing about any real model.
|
The stub returns the hashing embedder's own vectors, so this shows the plumbing and says nothing about any real model.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# A log file written by Spring Boot 4.2.0 itself (spring.application.name=shop)
|
# A log file written by Spring Boot 4.2.0 itself (spring.application.name=shop)
|
||||||
|
|
||||||
## The first three lines, and the ERROR with its first stack-trace lines
|
## The first three lines, and the ERROR with its first stack-trace lines
|
||||||
2026-12-01T23:53:34.953+05:30 INFO 12412 --- [shop] [main] o.a.maven.surefire.booter.ForkedBooter : Starting ForkedBooter v3.5.4 using Java 25.0.5.1 with PID 12412 (started by root in /tmp/work/java-ai-agents/log-anomaly)
|
2026-12-01T23:50:45.063+05:30 INFO 8974 --- [shop] [main] o.a.maven.surefire.booter.ForkedBooter : Starting ForkedBooter v3.5.4 using Java 25.0.5.1 with PID 8974 (started by root in /tmp/work/java-ai-agents/log-anomaly)
|
||||||
2026-12-01T23:53:34.975+05:30 INFO 12412 --- [shop] [main] o.a.maven.surefire.booter.ForkedBooter : No active profile set, falling back to 1 default profile: "default"
|
2026-12-01T23:50:45.065+05:30 INFO 8974 --- [shop] [main] o.a.maven.surefire.booter.ForkedBooter : No active profile set, falling back to 1 default profile: "default"
|
||||||
2026-12-01T23:53:37.369+05:30 INFO 12412 --- [shop] [main] o.s.boot.tomcat.TomcatWebServer : Tomcat initialized with port 0 (http)
|
2026-12-01T23:50:45.873+05:30 INFO 8974 --- [shop] [main] o.s.boot.tomcat.TomcatWebServer : Tomcat initialized with port 0 (http)
|
||||||
2026-12-01T23:53:38.561+05:30 ERROR 12412 --- [shop] [main] com.ankurm.shop.OrderController : Failed to process order 42
|
2026-12-01T23:50:46.352+05:30 ERROR 8974 --- [shop] [main] com.ankurm.shop.OrderController : Failed to process order 42
|
||||||
|
|
||||||
java.lang.IllegalStateException: quantity must be greater than 0
|
java.lang.IllegalStateException: quantity must be greater than 0
|
||||||
at com.ankurm.logs.RealSpringBootLogTest.theParserReadsWhatSpringBootActuallyWrites(RealSpringBootLogTest.java:23) ~[test-classes/:na]
|
at com.ankurm.logs.RealSpringBootLogTest.theParserReadsWhatSpringBootActuallyWrites(RealSpringBootLogTest.java:23) ~[test-classes/:na]
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import java.util.stream.Stream;
|
|||||||
/**
|
/**
|
||||||
* Parses the default Spring Boot console/file layout:
|
* Parses the default Spring Boot console/file layout:
|
||||||
* <pre>2026-11-30T09:00:00.123+05:30 INFO 4121 --- [shop] [nio-8080-exec-1] c.a.shop.OrderController : Order 42 placed</pre>
|
* <pre>2026-11-30T09:00:00.123+05:30 INFO 4121 --- [shop] [nio-8080-exec-1] c.a.shop.OrderController : Order 42 placed</pre>
|
||||||
* The bracketed application name appears only when {@code spring.application.name} is set (observed on 4.2.0, see
|
* The bracketed application name was added in Spring Boot 3.4; the pattern accepts logs with and without it.
|
||||||
* output/12); the pattern accepts logs with and without it.
|
|
||||||
* Any line that does not start with a timestamp is a continuation (a stack trace line) of the event before it.
|
* Any line that does not start with a timestamp is a continuation (a stack trace line) of the event before it.
|
||||||
*/
|
*/
|
||||||
public final class LogParser {
|
public final class LogParser {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class LogAnomalyTest {
|
|||||||
LogEvent withTrace = f.target.events().stream().filter(e -> e.message().startsWith("HikariPool-1 - Connection")).findFirst().orElseThrow();
|
LogEvent withTrace = f.target.events().stream().filter(e -> e.message().startsWith("HikariPool-1 - Connection")).findFirst().orElseThrow();
|
||||||
t.line("that ERROR event: level=%s logger=%s continuation lines=%d", withTrace.level(), withTrace.shortLogger(), withTrace.continuation().size());
|
t.line("that ERROR event: level=%s logger=%s continuation lines=%d", withTrace.level(), withTrace.shortLogger(), withTrace.continuation().size());
|
||||||
t.line("exception line: %s", withTrace.exceptionLine());
|
t.line("exception line: %s", withTrace.exceptionLine());
|
||||||
t.section("The same line without the application name bracket");
|
t.section("The same line without the application name (Spring Boot before 3.4)");
|
||||||
String old = "2026-11-30T09:00:00.123+05:30 INFO 4121 --- [nio-8080-exec-1] c.a.shop.OrderController : Order 42 placed";
|
String old = "2026-11-30T09:00:00.123+05:30 INFO 4121 --- [nio-8080-exec-1] c.a.shop.OrderController : Order 42 placed";
|
||||||
LogEvent e = new LogParser().parse(java.util.stream.Stream.of(old)).events().getFirst();
|
LogEvent e = new LogParser().parse(java.util.stream.Stream.of(old)).events().getFirst();
|
||||||
t.line("parsed: level=%s thread=%s logger=%s message=%s", e.level(), e.thread(), e.shortLogger(), e.message());
|
t.line("parsed: level=%s thread=%s logger=%s message=%s", e.level(), e.thread(), e.shortLogger(), e.message());
|
||||||
|
|||||||
Reference in New Issue
Block a user