This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-21
Channels
- # aws (1)
- # aws-lambda (1)
- # beginners (27)
- # boot (16)
- # cider (1)
- # clara (54)
- # cljs-dev (4)
- # cljsjs (8)
- # cljsrn (25)
- # clojure (148)
- # clojure-dev (2)
- # clojure-finland (1)
- # clojure-france (18)
- # clojure-italy (10)
- # clojure-nl (3)
- # clojure-russia (27)
- # clojure-sg (2)
- # clojure-uk (17)
- # clojurebridge (6)
- # clojurescript (70)
- # core-async (1)
- # css (6)
- # cursive (35)
- # data-science (3)
- # datomic (22)
- # events (4)
- # jobs (18)
- # jobs-discuss (14)
- # leiningen (4)
- # lumo (22)
- # off-topic (20)
- # om (5)
- # om-next (1)
- # onyx (47)
- # pedestal (107)
- # re-frame (43)
- # reagent (1)
- # ring (2)
- # ring-swagger (2)
- # rum (18)
- # sql (15)
- # unrepl (4)
- # vim (61)
- # yada (3)
Can someone give me an advice how to get the hot-loading feature on the development working in the REPL? A link would be helpful, I just couldn't find any relevant from the Pedestal issue or the Stackoverflow. I am running on Pedelstal version 0.5.2.
I have also followed this guide: http://pedestal.io/guides/developing-at-the-repl
I want to see the debug log messages of pedestals interceptor.chain namespace — can anyone point me how to enable debug logging for that namespace with pedestals logging lib?
I think I’m running into something where this line should be true but isn’t https://github.com/pedestal/pedestal/blob/master/interceptor/src/io/pedestal/interceptor/chain.clj#L75
thus I’m ending up with exceptions that are like “Interceptor Exception: Interceptor Exception: …."
@martinklepsch update the logback.xml config as such <logger name="io.pedestal.interceptor.chain" level="DEBUG" />
@ddeaguiar thanks!
BTW, I’ve found lnav (http://lnav.org/) to be an excellent tool for viewing logs. Here’s my lnav configuration: https://github.com/ddeaguiar/dotfiles/blob/master/shell/.lnav-formats/pedestal_log.json
@ddeaguiar actually was looking for something similar the other day and settled on some other tool. already forgot the name again lol
@ddeaguiar does it support viewing remote log files, potentially from multiple systems at once?
I’ve set up papertrail recently and while that’s helpful some terminal tool that shows me all logs might also be perfectly fine
that said it doesn’t seem to be within the scope of inav
I was looking for something that made it a bit easier to explore the data structures in the logs
From the lnav v0.8.0 release notes
- Integration with "" for querying and tailing server log and syslog messages. See the Papertrail section in the online help for more details.
- Remote files can be opened when lnav is built with libcurl v7.23.0+
Interesting!
being able to dynamically expand and collapse log lines was a huge plus for me but I suppose my expectations were low 🙂
I mostly look at logs with tail -f so I guess my expectations aren’t high either 😄
hehe, yeah. I just got tired of trying to eyeball the key/value pairs in logged request and context maps
In any case, my threshold for pain is pretty high. I’m pretty sure my usage of lnav came out of a pairing session with @christianromney. His threshold for pain is lower 🙂
spell of summoning...yes my pain threshold is notoriously low 🙂
How is everyone here reloading their app? I currently have to kill my repl if I make any changes to my service.clj
file
@ddeaguiar it was indeed
reloading your routes and the and any interceptors/handlers that changed should do it
for example, if your service code is in service.clj
as in the pedestal-service
template, just load that file after making changes
I just created a new pedestal service and I can change the home-page fn, reload and see the change
But it only works changes to routing in either case. Refer to https://github.com/pedestal/pedestal/blob/master/service-template/src/leiningen/new/pedestal_service/server.clj#L21
If you change other properties of the service map, like port, etc, then you need to restart
I @ddeaguiar I have the latest Pedestal template and it's not working for me
@ddeaguiar my intellij config: "Run nREPL with Leiningen" and "Synchronize Leiningen Projects"
@souenzzo I don't know if there's a way to do that right in the service map, but you can add a route like "/static" :get (io.pedestal.http.ring-middlewares/fast-resource nil)
That's the same interceptor that gets created for you when you put :resource-path on the service mpa
@mtnygard should the path parameter be the path in the resources
dir instead of nil
?
@ddeaguiar Probably. That's what I get for trying to beat you to the answer.
hehe, I’ve not used fast-resource
I was going to suggest io.pedestal.http.ring-middlewares/resource
Basically the same thing. Fast resource returns async and streams so time-to-first-byte is a bit better.
It uses http://clojure.java.io/resource, so it looks for anything visible in your classpath
It makes sense to me. It would be odd to have to start manipulating the path to get it to work
Maybe rename /resources/static
... And let some big comments arround.
So: there isn't standard way. I will dig into..
so, if you configured the interceptor with the root path of resources/public
then requests for /static/css/foo.css
would resolve to resources/public/css/foo.css
alternatively you can stick stuff in resource/static
and set ::http/resource-path
to /static
and call it a day