Best practices for Java logging from multiple threads?

前端 未结 12 1100
星月不相逢
星月不相逢 2020-12-03 02:39

I want to have a diagnostic log that is produced by several tasks managing data. These tasks may be in multiple threads. Each task needs to write an element (possibly with s

12条回答
  •  有刺的猬
    2020-12-03 03:35

    log4j is and has been the standard for java logging for many years. But if you don't fancy an external dependency then the java.util.logging package provides an acceptable solution.

提交回复
热议问题