0

I have a simple question. I'm working on a Java project where some objects of the same class register their execution in MySQL. I don't understand why but when the number of solutions in a table is a multiple of 500, the program gets stuck and no more solutions are found during a period.

I think in loggin the different objects but using log4j I only can have multiple logs with the same content. Does anybody know how to make different FileAppenders for different objects of the same class??

Thanks in advance.

1
  • Can we see what you have tried?
    – aug
    Dec 6, 2012 at 18:17

1 Answer 1

1

First , you'll need some way to identity the different instances of that class.

Second, log4j API shows how to create Logger's by name. You don't have to use the name of the class as the name of the Logger. You can create Logger's with names that vary for each instance, like:

Logger logger = Logger.getLogger("com.foo.Class" + idInstance);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.