1

I know that I can externalize my logback.xml with the -D param -Dlogback.configurationFile=... (See here).

I also know, that under Unix I have to do something like file://localhost/users/.../logback.xml to address an absolute file path.

But how do I do it on Windows? My absolute Path is something like G:my\logbakc\config\logback.xml

I use logback in combination with Slf4j and SpringBoot 1.2.2.RELEASE.

waXve
  • 792
  • 2
  • 9
  • 30
  • This should be the correct approach for referencing file paths on Windows. http://stackoverflow.com/a/8406282/1990536 – Rai Jan 15 '16 at 21:43

1 Answers1

0

If you simply want to configure loggers levels in your externalized logback.xml, you could also do it in your application.[properties|yml] spring-boot configuration file:

logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR

Indeed, the application configuration file's externalization feature is already integrated in spring-boot (see documentation here).

See spring-boot's documentation about this topic.

  • It's nice to know that I can configure the logging level with the properties. But that is not exactly what I want. I want to use this to run the application on the server and that the System Administrators can put a logbackfile somewhere on the filesystem and edit it. Not only the logging level, but also the paths to the logfile or even the appenders. – waXve Aug 26 '15 at 09:44
  • Ok, I understand. In this case, I don't have the answer to your question, sorry :-/ – Denis Colliot Aug 26 '15 at 09:53