My use case is as following (pseudo code):
def addUser(user) {
MDC.put(user.id)
LOG.trace(MyMarkers.ENTRY_POINT, "adding user {}", user);
calcUser(user)
MDC.remove(user.id)
}
def calcUser(user) {
calcUserName(user)
}
def calcUseName(user) {
storeUserInCache(user)
}
storeUserInCache(user) {
// is this a good use case? in case I want to enable CACHE feature in TRACE
// in logs (for the sake of example or any other feature to enable its tracing
// in logs i mark different TRACE with different markers.
LOG.trace(MyMarkers.CACHE, "storing user {} in cache", user);
}
getUserFromCache(userid) {
LOG.trace(MyMarkers.CACHE, "getting user {} from cache", userid)
}
now what i meant by the above is the ability to toggle TRACE on
for userid
by its MDC
and i can also toggle on or off logs for different features. for example by using the CACHE marker
I can have my application log all CACHE
features in TRACE
just because I want to see all caches in trace. is the CACHE marker
a good use case for markers
? as a toggle to see all CACHE
feature in TRACE
in my logs?