Search code examples
clojurefrontendclojurescript

ClojureScript get logs in serverside


How using Clojurescript get logs in serverside. I am using taoensso.timbre for logging and some of those logs are displayed in browsers console. How to make logs appear on the machine where Leiningen process started. I am using Figwheel and wanting to push all the logs into servers console. Is there a possibility to do so? Or maybe a browser supports that?


Solution

  • More than likely, you'll want to wrap the timbre logging functions. You can write a function with the same signature as your logger, and make it responsible for both local and remote logging. After using the vanilla logging to report to the javascript console, you'll want to make an async request with a library like https://github.com/JulianBirch/cljs-ajax to your logging service of choice.