blaze icon indicating copy to clipboard operation
blaze copied to clipboard

Broken file name/line number in logs

Open kamilkloch opened this issue 3 years ago • 2 comments

Sample log line:

[2022-08-04 11:50:05,273] INFO  [io-compute-0] o.h.b.s.Http1ServerStage$$anon$1:271 - HTTP body not read to completion. Dropping connection.

Log entry claims this is Http1ServerStage from http4s-blaze-server. Actual logging takes place in Http1Stage:271 from http4s-blaze-core.

Problem is that logger instance gets passed around between components - either by accessing parent class' logger (org.http4s.blaze.pipeline.Stage defines logger that is protected and used in derived classes), or by explicit passing around logger reference (org.http4s.blaze.server.Http1ServerParser).

This is an antipattern which renders the logs much less user-friendly.

kamilkloch avatar Aug 04 '22 10:08 kamilkloch

Thanks for the report! I guess this is a blaze-specific issue, right? I guess it should be transferred then, I think @danicheg can do that.

https://github.com/http4s/blaze

armanbilge avatar Aug 04 '22 13:08 armanbilge

Should I open this issue in blaze? Update: Never mind, I guess issue can be directly transferred.

kamilkloch avatar Aug 04 '22 13:08 kamilkloch