Hi All:

Is the following an odd-ball use case or a super-niche use case, and should we do anything about it.

I have a part of our app that throws and logs an exception with the usual:

logger.throwing(new FooException(...));

Elsewhere in this class and in the same method, I have softer errors for which I log a warning with a a custom marker.

What I really want is to be able to filter out both log events based on this marker but not other kinds of events, hence the use of Markers.

I cannot say:

logger.throwing(myMarker, new FooException(...)); 

Our implementation marks throwing() log event (helpfully) with its own THROWING_MARKER.

I could make my custom marker a child of THROWING_MARKER, but that is really not semantically correct, is smelly and therefore a nasty hack IMO.

If I had a logger.throwing(Marker, Throwable); API, how would it work?

I would say that LogEvent should hold an array of Markers, not a single one.

What does this sound like to you all? Craziness or a power-user refinement?

Let's only consider throwing() for now before we even think about adding Logger APIs that take Marker[]s.

Gary


--