Logback: print text only if a context variable is defined -
i'm using logback logger , i'm putting information in logging context in order print out in log file.
i differentiate printed message based on presence of information in context.
using name context key:
when
namekey present print like:[name = john] - i'm logging messagewhen
namekey not present print like:i'm logging message
Comments
Post a Comment