Using log4j in Swing application
Our Swing application doesn't limit the number of application instance user opens that is user can run as many app instances as he likes by accessing JWS link more than once. Here my question is if I use log4j for logging many app instances(jvm) will share the开发者_如何学编程 same log file, right? Are there any lock issue for this or these app instances can write their logs into the same log file without conflict?
Well, the question is: is it a good method to let all instances of your application wriite into one file. The meaning of logging is to recognize the bugs in your application. If you use the same file you won't know which instance throwed the exception and where the bug appears. May be you can change your logging-architecture so this mistake won't happen. Try to count the instances, or generating an instanceID and appending it to the log-file,
精彩评论