title: How do I add a prefix to log4j messages (at the object level)
body: <p>I use log4j2 and I would like to add a prefix to all my messages. This prefix is passed to the constructor parameter and it depends on the instance of the class. So we're at the object level (not class or thread).</p>
  
  <p>For example, I have an <code>A</code> class instantiated like <code>new A(152)</code>, so when I use <code>log.error("message")</code> on this class, <code>152:</code> is written just before the message. For <code>new A(155)</code>, <code>155:</code> will be displayed instead.</p>
  
  <p>Thanks for your help</p>