Hi @paul_macharia!
I'm sorry for taking so much time for answering your question! This is kind of complex and takes some time to explain.
Briefcase uses SLF4J and Logback for logging, and it's shipped with a default logging configuration that will leave a briefcase.log
file wherever you launch Briefcase. It does some other stuff like rotating the log file once a day, but that's not important.
I see that you've already tried to change the logging configuration by providing a different configuration file with the -Dlogging.config=/path/to/config/file.xml
JVM flag, which is great. It would help me to know the contents of the logback.xml
file you've created.
This is the standard configuration file that's bundled with Briefcase:
<configuration>
<appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>briefcase.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>briefcase.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
<totalSizeCap>100MB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="ROLLINGFILE" />
</root>
</configuration>
As you can see, the <appender name="STDOUT" .../>
doesn't say where the log file should be saved (it only defined the filename). This is done by design to get the log file at the same path where you run the java -jar briefcase.jar
command.
If you want Briefcase to leave the log file at some specific, fixed path, you would need to change the appender.rollingPolicy.fileNamePattern
value:
<configuration>
<appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>briefcase.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>C:\some\fixed\path\briefcase.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
<totalSizeCap>100MB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="ROLLINGFILE" />
</root>
</configuration>
This configuration would leave the log file at C:\some\fixed\path\briefcase.log
On the other hand, if you'd prefer Briefcase to spit out log contents on the console, you could have this configuration instead:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
</configuration>