Cast logs not appearing locally

Hi, has anyone been able to make the (cast/dev {:msg "something"}), and (cast/event ...) functions print anything locally? If so, what sometimes gave you trouble, how did you make it work?

When I follow the instructions here, I get no errors but no logs either:

https://docs.datomic.com/cloud/ions/ions-monitoring.html#local-workflow

This post provides a look at what I tried:


https://ask.datomic.com/index.php/556/how-do-i-use-datomic-ion-cast-to-log-on-my-development-machine

With the current issue we find it difficult to unify our dev and prod parity when different kinds of logging work only in half of our environments.

Because of this, we’re tempted to use SLF4J instead but the logs don’t appear as great in CloudWatch as the cast logs appear:

1 Like

I’ve been suffering from this for a while, and had to just workaround by using println in dev for a while … although, seeing your post inspired me to re-investigate the issue again in my environment, because when I first started the project it was working. I messed around with a lot of different require combinations …

I was finally able to get cast/dev to actually work again in my local environment, once I removed my require call for datomic.dev-local, something in requiring that was interfering with my cast logging. After discovering that, I was able to still require datomic.dev-local so long as BOTH the cast init call AND a single/first call to cast/dev was made before requiring dev-local.

Do you think this is the same thing affecting you as well?? Either way, sounds like dev-local OR datomic.ion.cast might have some kind of bug that doesn’t allow them to play well … (unless I’m doing something wrong)

3 Likes

:partying_face: Wow thanks a lot Jake, that’s exactly the solution we needed!

CC @jaret you might be interested to know about Jake’s solution. Do you think Cognitect needs to fix something? At least we know the workaround until then. :slight_smile:

1 Like

Awesome! Glad we’re finally getting to the bottom of this (now people can stop telling me that I must be forgetting to call initialize :stuck_out_tongue:)

For reference, I’m using dev-local version: 0.9.232 - and ion lib version: 0.9.48

1 Like

Hi @jmshelby would it be possible to share a small repo? I am assuming from reading this that a project with ion.cast and dev-local will re-create, but I’d like to see if you have anything else contributing.

Apologies for likely being one of the people to tell you to initialize! :slight_smile:

Sure, here’s something I just threw together to demonstrate. It should be the minimum amount to recreate with some of the deps I’m using.

Has there been any documented resolution of this issue? If so, in which version of datomic(ions) and/or dev-local?

@cch1 This is not currently resolved, but is slated for our next maintenance release. If you include dev-local on the classpath you will encounter this issue when trying to use cast locally. You can avoid this by putting dev-local in an alias.

1 Like

Resolved now, as per ion 1.0.62.

After the upgrade and having removed my workarounds in our codebase, I can’t reproduce the original issue anymore.

Thanks Cognitect!