Log4J's markers are not as flexible as markers in SLF4J.
First, SLF4J's markers are mutable. By allowing markers to be mutable, I can change the relationship of markers to each other based upon runtime or business conditions.
Second, and more importantly I think, is that essentially SLF4J markers have this parent/child relationship, much like Log4J, except that in SLF4J, I can essentially have a marker with multiple parents. For example, I might want this structure:
- Travels by
Of course, this is a contrived example, but I wanted to describe the relationships. Now, if I wanted to filter based on markers that travel by Water for some appenders, and another appender wants to filter by Mammals, I can't simply use the single marker of Dolphin.
Either we need to reverse the marker relationship so that it contains its children, much like SLF4J, or we allow markers to have multiple parents, which I prefer because it could make it more succinct to define:
As for the Marker API, we would either need to change getParent to getParents, or get rid of the getParent method from the API and just rely on the isInstanceOf method to handle checking multiple parents by looking at private member variables (my preference)
[ If we want
getMarker(String name, String parents)
getMarker(String name, Marker parents)
let make sure it really is:
getMarker(String name, String... parents)
getMarker(String name, Marker... parents)
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Fix Version/s||2.0-rc2 [ 12326292 ]|
|Resolution||Fixed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|14d 13h||1||Bruce Brouwer||14/Apr/14 03:05|
|20d 11h 50m||1||Bruce Brouwer||04/May/14 14:56|