bertzzie
bertzzie

Reputation: 3568

See Generated Query with Phantom

I am using the phantom cassandra DSL for scala. What I want to do is simple: I want to see and logs the generated queries for every time there's a query.

I can't find anything on the wiki or tutorials and searching across the web.

Any help with that? Thank you very much.

Upvotes: 0

Views: 426

Answers (3)

derMicha
derMicha

Reputation: 11

With Phantom 1.22.0 I see in our app all queries in our logs with this entry inside our LogBack.xml:

<logger name="com.websudos.phantom" level="DEBUG"/>

Hope that helps.

Upvotes: 1

flavian
flavian

Reputation: 28511

At any point in the query you should be able to call .qb.querystring to print out the query, this will simply return a string containing the serialisation formed by everything in the chain up until that point.

Phantom is 100% immutable and as a result you will even be able to walk through intermediary stages.

Upvotes: 2

Citrullin
Citrullin

Reputation: 2321

Normally, if you start your application, phantom writes all queries to your console. You can write this output to a file:

sbt 'run' > log

Upvotes: 0

Related Questions