is there a simple demo of getting quasi-normal htt...
# ktor
g
is there a simple demo of getting quasi-normal http logging out of ktor?
o
Depends on your definition of quasi-normal 🙂 What do you mean? Installing
CallLogging
feature is not enough?
g
CallLogging in my app doesn't result in any log lines
to no luck
Copy code
INFO [2018-01-29 13:19:31,071] (ApplicationEngineEnvironmentReloading - main) - No ktor.deployment.watch patterns specified, automatic reload is not active
that's all I've got in the stdout log
if I up the loglevel in
log4j.properties
I get a spew of non-ktor logs, but no actual HTTP logging
(this is in 0.90)
o
Did you add the
logback.xml
to resources? If you call slf4j manually, does it work?
g
Added logback.xml to resources
Manually logging via slf4j works fine
it is as if ktor itself is not emitting http logs
s
are you sure you're passing
level
to
CallLogging
? It's TRACE by default if you don't
This works fine for me
Copy code
install(CallLogging) {
            level = Level.DEBUG
        }
you must be running something other than 0.9
and we have yet to get ktor-devel to correctly build
have historically been blocked by deps referencing internal mavens
haven't tried in a month or so though
s
ktor_version = '0.9.1-alpha-9'
for me
just tried with 0.9.0. also didn't work for me even after raising loglevel to TRACE
g
bumped to 0.9.1-alpha-9, set every loglevel to TRACE that I can find, and still nothing
got it worked out
sigh, pre-stable. I get it.
o
What was the reason it didn’t work?
g
not running the alpha-9
the loglevel property of the
CallLogging
setting the output log level, not indicating a minimum level to log
the logback.xml default filtering out trace, which is the default value of the
CallLogging
module
o
I see, do you have an idea how to improve the API to avoid confusion?
g
literally any documentation would be helpful. I've spent the last month and a half working on a non-trivial project based on 0.9, and I'm close to my wits end
the amount of indirection in the codebase is at times harder to follow than projects like rails, despite being in a non-dynamic language
and the lack of documentation/published guiding philosophy to how/why this works at all means "just read the source code" is difficult advice to actually follow
i'm sure this will happen eventually, and the java ecosystem desperately needs a dev-friendly http framework, and I don't mean to discount the enormous effort it is to build something like this
but my takeaway is that I should probably have not jumped in so aggressively to build on top of it
among other things: yes, in 0.9 you can get a websocket connection to upgrade, but no, you can't test it at all
and finding that out took a few days of trying very hard to do it anyway
o
Thanks for honest feedback! My takeaway would be “more docs” and “more rails” right?
@Deactivated User ^^
👍 1
@gotwalt I think we have websocket tests, did you take a look at them? /cc @cy
g
because it's reasonable to think that testability would be part of the delivery of that feature
i don't think more rails is necessarily a great answer to the question
you have tests to determine if the upgrade works
but no way for a dev to test the functionality of their websocket code itself
i could verify that the connection is open
i believe that perhaps in the latest alpha this has been addressed
o
With “rails” I mean something like best practices, guided tours, etc.
g
yeah, i mean, i'd settle for some docs on "here's what we believe a
Feature
should do, and why"
o
Testability of WS might be an omission, we’ll have to look at that.
g
it's clear, for example, with the changes to auth, that your ideas about how/why it should work have changed
which is totally fine and understandable
but from the outside, it's hard to tell where it's going
and hard to then figure out how to make it work, given the lack of docs and the static method extensions that hold everything together
o
We explore different options and try to see if it works, but of course we have some bias and inner knowledge, and that’s why such feedback is very valuable. Thanks again!
g
i think guided tours etc are very nice to have, but i'd settle for something grittier for now
i get, and i suspect a lot of people here get that this is alpha
and we're excited for a non-bad http option on the jvm
so trying to temper my gripes with positivity. thanks for working on this!
o
“non-bad” looks like a compliment! 😄