5

I am using log4j and I cant figure out, how to create log file for specific classes (in my case for security messages).

I want to have one global log, where I will log everything (INFO), and some package specific log files for debugging, testing and security of some parts of my app.

For instance I want to log only events from LoggerListener (Spring security) to file security.log, and only messages from my apps package cz.flexibla2 *to flexibla2.log* etc.

Thanks for your help.

malejpavouk
  • 4,297
  • 6
  • 41
  • 67
  • 4
    See http://stackoverflow.com/questions/728295/creating-multiple-log-files-of-different-content-with-log4j , that's probably pretty close to what you are looking for. – Glenn McAllister Jan 14 '11 at 14:46
  • Yep, Glenn's link is what you're looking for. Also google for "log4j additivity" – darioo Jan 14 '11 at 14:51
  • thanks, works for me....I had it configured in properties file, but it seems, that XML config is much more flexible. – malejpavouk Jan 14 '11 at 15:26

0 Answers0