datomic

Ask questions on the official Q&A site at https://ask.datomic.com!
Sam DeSota 2020-09-15T17:46:06.452700Z

I’m trying to disable some logging on a peer server that’s painfully verbose, but I can’t seem to make any progress with the docs. I have lein project that’s using datomic-pro , tried to add a bin/logback.xml but I’m not really sure how I actually configure datomic to pickup on that file (I added the slf4j exclusion so the datomic pro lib using logback), since I’ve changed all the loglevels to warn with no change in the verbosity. Also tried to use (.setLevel (org.slf4j.LoggerFactory/getLogger "datomic") ch.qos.logback.classic.Level/WARN) with no progress. Let me know if there’s tips on how to disable the DEBUG logging by default.

favila 2020-09-15T17:50:38.452800Z

If you use the bin/run method of starting, it should have logback.xml on the classpath already

favila 2020-09-15T17:51:40.453Z

alternatively, you can include the -Dlogback.configurationFile= property to point to your own logback file

favila 2020-09-15T17:52:56.453200Z

wait, do you mean “peer-server” or “peer, that is also a server”?

Sam DeSota 2020-09-15T17:53:09.453400Z

I got it, just wasn’t familiar with the convention. I added logback.xml to my resources dir so it’s in my class path, not using bin/run, it’s a peer that’s also a server 🙂

Sam DeSota 2020-09-15T17:53:32.453600Z

Thank you

favila 2020-09-15T17:54:45.453800Z

ah, ok. that’s different. I recommend always using the property btw instead of putting it on the classpath (except maybe in dev, where you can put the logback in dev-resources)

favila 2020-09-15T17:55:49.454200Z

that’s maybe not especially helpful

Sam DeSota 2020-09-15T17:55:59.454400Z

Yup, I’m on that page. I’ll add the property on deploy.

enn 2020-09-15T21:44:18.457800Z

I'd like to write a :where clause which will unify and bind a certain var if the relevant attribute is present, but which won't prevent the whole clause from matching if that attribute isn't present. Something like this:

:where [?foo-id :foo/id "123"]
       [?foo-id :foo/bar ?foo-bar]
Except I want it to match every :foo/id of 123, regardless of whether :foo/bar is present. But if it is present, I'd like to bind it to ?foo-bar. Is this possible?

2020-09-15T22:16:34.459200Z

I'm not sure I understand you correctly, but it sounds like get-else

👍 1
kennytilton 2020-09-15T22:58:18.460800Z

Look for get-else half way down: https://docs.datomic.com/on-prem/query.html @enn Could be a fit.

enn 2020-09-15T22:58:40.461200Z

thank you, I’ll check that out