0

Is that possible with one config?

  1. log4j write log to file only when we run project as:java -jar project.jar &
  2. log4j write log to file and print on console when we run project in eclipse
John Zhang
  • 381
  • 1
  • 3
  • 22

1 Answers1

0

Maybe you can have a look at this answer, which seems to describe the same problem.

By using different Spring's profiles, you can switch from one configuration to another very easily, with multiple application.properties files which contains the property logging.config pointing on different log4j config files.

An other option is to use the default Spring Boot's logging mechanism, Logback which allows you to use the <springProfile> tag. See here for more details.

gWombat
  • 517
  • 2
  • 11