Why a new instance uses logger from old instances?
- by Roman
I generate 2 instances in this way:
gameManager manager1 = new CTManager(owner,players1,"en");
manager1.start();
gameManager manager2 = new CTManager(owner,players2,"en");
manager2.start();
The start() method of the gameManager looks like that:
void start() {
game.start();
}
When I create the game instance I create a loger: log = Logger.getLogger("TestLog");
(log is a public field of the class in which the game belongs).
In the game.start() I run many processes and give them a reference to the corresponding log. So, I expect that manager1 and manager2 will write to different files. But manager2 writes to its own file and to the log file of the manager1. Why can it happen?