Fork me on GitHub
#ring
<
2022-02-01
>
bherrmann02:02:19

Is there any handy way to suppress this Jetty output (Logging initialized) ?

$ cat deps.edn 
{:deps {
  ring/ring-core {:mvn/version "1.8.2"}
  ring/ring-jetty-adapter {:mvn/version "1.8.2"}}
}
$ cat src/holy.clj
(ns holy
  (:require [ring.adapter.jetty]))

(defn -main [ & args ]
  (println "I dont do much")
  )
$ clj -M -m holy
2022-01-31 21:27:15.648:INFO::main: Logging initialized @1064ms to org.eclipse.jetty.util.log.StdErrLog
I dont do much

seancorfield03:02:12

@abdusalam’s suggestion looks good @bherrmann:

seanc@Sean-win-11-laptop:~/oss$ clj -Sdeps '{:deps {ring/ring {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require 'ring.adapter.jetty)
2022-01-31 19:06:00.540:INFO::main: Logging initialized @3922ms to org.eclipse.jetty.util.log.StdErrLog
nil
user=>
seanc@Sean-win-11-laptop:~/oss$ clj -J-Dorg.eclipse.jetty.util.log.announce=false -Sdeps '{:deps {ring/ring {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require 'ring.adapter.jetty)
nil
user=>

bherrmann02:02:38

I tried this, but it seemed to have no effect,

$ cat src/jetty-logging.properties 
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.LEVEL=WARN

bherrmann02:02:12

I also tried,

$ clj -J-Dorg.eclipse.jetty.http.LEVEL=OFF -M -m holy
2022-01-31 21:49:52.199:INFO::main: Logging initialized @1078ms to org.eclipse.jetty.util.log.StdErrLog
I dont do much

seancorfield03:02:12

@abdusalam’s suggestion looks good @bherrmann:

seanc@Sean-win-11-laptop:~/oss$ clj -Sdeps '{:deps {ring/ring {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require 'ring.adapter.jetty)
2022-01-31 19:06:00.540:INFO::main: Logging initialized @3922ms to org.eclipse.jetty.util.log.StdErrLog
nil
user=>
seanc@Sean-win-11-laptop:~/oss$ clj -J-Dorg.eclipse.jetty.util.log.announce=false -Sdeps '{:deps {ring/ring {:mvn/version "RELEASE"}}}'
Clojure 1.10.3
user=> (require 'ring.adapter.jetty)
nil
user=>

bherrmann12:02:51

@seancorfield @abdusalam Thanks!!! I appreciate it! My program only sometimes starts a web server, so having it always log this message was irritating. I burned at least an hour on this.