This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-05
Channels
- # aws (12)
- # babashka (30)
- # beginners (294)
- # calva (98)
- # clj-on-windows (3)
- # clojure (48)
- # clojure-europe (31)
- # clojure-italy (8)
- # clojure-nl (2)
- # clojure-uk (11)
- # clojurescript (58)
- # conjure (1)
- # events (1)
- # fulcro (35)
- # graalvm-mobile (2)
- # jobs (8)
- # lsp (11)
- # malli (25)
- # off-topic (33)
- # pathom (24)
- # pedestal (1)
- # polylith (15)
- # re-frame (7)
- # reitit (10)
- # releases (8)
- # remote-jobs (2)
- # sci (3)
- # shadow-cljs (79)
- # spacemacs (10)
- # sql (17)
- # tools-deps (17)
- # vim (4)
- # xtdb (11)
im getting 5 of these log messages from the cognitect aws-api:
Jul 05, 2021 7:22:53 PM com.amazonaws.auth.profile.internal.BasicProfileConfigLoader loadProfiles
WARNING: Your profile name includes a 'profile ' prefix. This is considered part of the profile name in the Java SDK, so you will need to include this prefix in your profile name when you reference this profile from your Java code.
how can i disable them?after these messages, i also see another log message on the stderr:
2021-07-05 19:22:54.723:INFO::nREPL-session-c95f0d6e-f1cc-472d-85b4-dcd1d1820ae8: Logging initialized @109640ms to org.eclipse.jetty.util.log.StdErrLog
so it seems this jetty logger is starting after the amazon libs has already sent some logs.according to https://docs.huihoo.com/jetty/the-definitive-reference/configuring-logging.html , i should be able to just do something like clj -J-Dcom.amazonaws.auth.profile.internal.LEVEL=OFF
to suppress these messages, but that didn't work.
i also tried to put a jetty-logging.properties
on my classpath, but interestingly enough (
just returns nil
.
im working on a minimal repro case now, but if anyone has some pointers to some examples, it would be great.
We are using awscli v2, so we can use single sign on. For that we need to have section names in ~/.aws/config
to be prefixed with "profile<space>" and that triggers these warnings.
(It's really painful, because these warnings often totally obscure the useful output...)
After reading the docs of a bunch of logging related libs, this is what worked for me finally:
1. create a logging.properties
file at the same directory level as the deps.edn
file. NOT in src/
or whatever dir, which is on the classpath! example content:
handlers=java.util.logging.ConsoleHandler
.level=INFO
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%1$tF %1$tT] [%4$-7s] %3$s: %5$s%6$s%n
cognitect.aws.credentials.level=WARNING
2. reference this file via :jvm-opts
in deps.edn
. eg, here is a map-entry from the :aliases
:
:aliases
{:dev
{:extra-paths ["dev"]
:jvm-opts ["-Dclojure.tools.logging.factory=clojure.tools.logging.impl/jul-factory"
"-Djava.util.logging.config.file=logging.properties"]}
}
and also wire up the jul
(`java.util.logging`) to the clojure.tools.logging
abstraction layerI still see a log message, which has a different format, than the one I specified, and I can't suppress it:
(def s3 (aws.api/client {:api :s3}))
2021-07-06 05:28:44.781:INFO::nREPL-session-2b108885-7ed5-4894-bedd-6077fd6b02c0: Logging initialized @12704ms to org.eclipse.jetty.util.log.StdErrLog
actually, this is the line needed in logging.properties
, for suppressing the warnings about the "`profile `" prefix:
com.amazonaws.auth.profile.internal.BasicProfileConfigLoader.level=SEVERE
managed to suppress the jetty related log message too. took this advice: https://stackoverflow.com/a/53064639/263983 and added "-Dorg.eclipse.jetty.util.log.announce=false"
to the :jvm-opts
too.
where would be a good place to put all this info, so more cognitect.aws.api and datomic cloud users can benefit from it?
The datomic forum maybe? Someone official would say least see it there and meet help redirect. Also it's persistent