Fixed that on releases (which is important for desktop app bundles) logs get written to user's home dir
This commit is contained in:
parent
6a8b913bc4
commit
5d0669c5fe
|
@ -124,6 +124,7 @@ kotlin {
|
|||
implementation(libs.favre.bcrypt)
|
||||
|
||||
implementation(libs.logback)
|
||||
implementation(libs.janino)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
<configuration>
|
||||
|
||||
<property name="logDir" value="${user.home}/.bankmeister" /> <!-- For Release, write to the user's home directory -->
|
||||
|
||||
<if condition='property("ENV").equalsIgnoreCase("debug")'>
|
||||
<then>
|
||||
<property name="logDir" value="${user.dir}/data" /> <!-- For Debug/Development, write to the current directory -->
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<if condition='property("ENV") == "debug"'>
|
||||
<then>
|
||||
<property name="logDir" value="${user.dir}/data" /> <!-- For Debug/Development, write to the current directory -->
|
||||
</then>
|
||||
</if>
|
||||
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
|
@ -17,7 +31,7 @@
|
|||
<timestamp key="bySecond" datePattern="yyyyMMdd'T'HHmmss"/>
|
||||
|
||||
<appender name="file" class="ch.qos.logback.core.FileAppender">
|
||||
<file>data/logs/Bankmeister-${bySecond}.log</file>
|
||||
<file>${logDir}/logs/Bankmeister-${bySecond}.log</file>
|
||||
<!-- encoders are assigned the type
|
||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
|
|
|
@ -12,6 +12,7 @@ favre-bcrypt = "0.10.2"
|
|||
|
||||
klf = "1.6.2"
|
||||
logback = "1.5.7"
|
||||
janino = "3.1.12"
|
||||
|
||||
sqlDelight = "2.0.2"
|
||||
|
||||
|
@ -45,6 +46,7 @@ favre-bcrypt = { group = "at.favre.lib", name = "bcrypt", version.ref = "favre-b
|
|||
|
||||
klf = { group = "net.codinux.log", name = "klf", version.ref = "klf" }
|
||||
logback = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
||||
janino = { group = "org.codehaus.janino", name = "janino", version.ref = "janino" }
|
||||
|
||||
sqldelight-runtime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDelight" }
|
||||
sqldelight-coroutines-extensions = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqlDelight" }
|
||||
|
|
Loading…
Reference in New Issue