Log4j properties in log path

2013-05-27 Thread Thomas Andraschko
Hi, AFAICS properties in the filename of a RollingFile Appender are not supported anymore. Currently i manually load the xml, replace the name of the property and initialize the config via ConfigurationSource but that's not a nice solution. How can this be done without such hacks in log4j2?

Fwd: How do I add a prefix to log4j messages (at the object level)

2013-05-27 Thread Lucie Boubée
Hi, I use log4j2 beta 6 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). For example, I have an A class instantiated like new A(152), so when I

Re: How do I add a prefix to log4j messages (at the object level)

2013-05-27 Thread Remko Popma
On 2013/05/27, at 23:50, Lucie Boubée lbou...@gmail.com wrote: Hi, I use log4j2 beta 6 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).

Re: How do I add a prefix to log4j messages (at the object level)

2013-05-27 Thread Lucie Boubée
2013/5/27 Remko Popma rem...@yahoo.com On 2013/05/27, at 23:50, Lucie Boubée lbou...@gmail.com wrote: Hi, I use log4j2 beta 6 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

Re: How do I add a prefix to log4j messages (at the object level)

2013-05-27 Thread Ralph Goers
You could use a custom MessageFactory. public class MyMessageFactory extends ParameterizedMessageFactory { private final String objId; public MyMessageFactory(Object obj) { this.objId = obj.toString(); } @Override public Message