Using Log4J 1.*, how can I write two packages to two separate files?

前端 未结 4 1532
终归单人心
终归单人心 2020-12-31 11:11

I have the following two packages:

com.mycorp.project.first
com.mycorp.project.second

I\'d like to configure Log4J (SLF4J) to write the logs from one pac

4条回答
  •  醉梦人生
    2020-12-31 11:13

    put dynamiclly file path .in log4j.properties

    log4j.appender.FILE.File=${file.name}
    

    And in java set file path System.setProperty("file.name", FILEPATH);

提交回复
热议问题