Reputation: 12283
I'm using logback and the log location will vary depending on the platform (see my other related question: What's the best practice for log file locations in Java desktop applications?).
How do I tell logback to use the log file determined from the platform? I cannot hard code the log file in logback.xml because it will be a different file for each platform.
I do need the settings from logback.xml to be used for the file appender, though.
I have a console appender in logback.xml. Perhaps for this additional requirement the settings can be transfered to the file appender?
So to be clear, this is a two part question:
Upvotes: 2
Views: 150
Reputation: 533500
You are going to have to put in configuration somewhere. The simplest is to have a logback.xml for each platform, but you could have another configuration file or use a command line property (which means a different startup for each platform)
Upvotes: 1