Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dinamic variables value in log4j

 
mickey hendrix
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello to everybody....I have a problem with log4J..
I need to pass a variabe value before all the log line...example

[MICKEY] 20050606 - Log Message!!
[MINNIE] 20050606 - Log Message!!

etc.....where the first word changes.....hoe can I do?can qnyone help me please?
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html on how to format log4j messages.

perhaps you can name the loggers or use precision specifier to print parts of the message ?


pascal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic