Hello every one, I am failing to configure ktor `e...
# ktor
a
Hello every one, I am failing to configure ktor
embeddedServer(CIO)
to auto reload. I believed I have followed the documentation and have everything in place, but still auto reload wont work •
build.gradle.kts
contains
"-Dio.ktor.development=true"
• my main function contains
embeddedServer(...,watchPaths=listOf("classes"))
I am running
./gradlew :build -t
(also tried with
jar
and
assemble
) in one terminal and running
./gradlew :run
in another. I make changes and save the main file (the rebuild happens in the build terminal) I go to the browser and refresh the page but changes are not reflected. I am on
kotlin 2.0.0
,
Java 18.0.2.1
, tried ktor (
2.3.9
,
2.3.12
and
3.0.0-beta-2
) to no avail. What else am I missing here??
a
Do you see logs saying that the auto-reloading is watching for package changes? For example:
Copy code
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/gpt for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/META-INF for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/algo for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/exposed for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/packageB for changes.
LOG [] DEBUG ktor.application Watching /home/stexe/projects/ktor_sandbox/build/classes/kotlin/main/packageA for changes.
a
No, I do not see these logs at all
a
Then either the logger doesn't log on the DEBUG level or the development mode is off.
a
I have checked that development mode is set calling
System.getProperty("io.ktor.development")
returns true. What more do I need to do to enable logging?
a
You can find the information about the logging configuration in the documentation.
v
Same issue with kotlin 2.0.21, works fine on 1.9.xx.