I am developing a game server based on the top of someone else framework, netty and spring.
And I wonder whether it is a good approach to generate a separate file using log4j for every game room or not. Since with many game room servers has to keep open a lot of log files. On the other hand with only one log file it would be a total mess up which would required parsing and filtering when analyzing a problem.
If many log files is still a good approach when I need to know how to implement that. I have had a look at this question configure log4j to log to custom file at runtime, but first answer is not clear, how to minimize lines of code required in every attempt to write to a separate log file. I have tried the second answer with putting in config file
log4j.appender.logfile.File=${logfile.name}
but the framework has
PropertyConfigurator.configure(System.getProperty("log4j.configuration"));
which fails if log file is not specified at the start time.
Any ideas and comments are welcome! Thanks
UPD: This link also seems helpful in my case. Log4j logging to separate files But still: is it good idea and how to switch dynamically the output log file with minimal coding.