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 name key present print like:

    [name = john] - i'm logging message

  • when name key not present print like:

    i'm logging message


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -