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:
- How do I add a file appender with a location based on the platform.
- How do I have this file appender keep the settings defined in logback.xml.