Several different approaches could accomplish your goal. The most straight 
forward likely would be to specify a custom layout class in your configuration 
and would require no modification of your code.  Unless the layout in an 
appender wrapped by an AsyncAppender, the layout will be run in the context of 
the logging request and should have access to the thread's state at the time of 
the call.


On Nov 22, 2011, at 1:26 AM, bbalaganapathy wrote:

> 
> Adding Prefix text to existing log.info In our present application we have
> lot of log.info() statements.I want to add the some prefix text which is
> dynamic to all these statements.
> e.g) Existing log: log.info(" Current value is:"); 
> For the above line will get the output as Current value is:
> 
> I want to append the login user name which is dynamic i.e.) Bala Current
> value is: 
> Is there any way we can achieve this without modifying all log statements? 
> 
> Thanks in advance. 
> 
> Regards,
> Bala
> -- 
> View this message in context: 
> http://old.nabble.com/Adding-Prefix-text-to-existing-log.info-statement-tp32872102p32872102.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to