2
votes

How can I stop py2neo from spitting out each created relationship/node, like the following:

(http://localhost:7474/db/data/' ref=u'relationship/13441' start=u'node/13446' end=u'node/3' type=u'IN' properties={}>,)

As encouraged by this page, when I set the below line to OFF

java.util.logging.ConsoleHandler.level=OFF

I silence logging when I call a function which creates the relationship/node. However, if I directly create something (graph.create(...) in my main, then I still see this print to the console.

3

3 Answers

6
votes

I followed this answer to another question and was successful in suppressing the log messages

logging.getLogger("py2neo.batch").setLevel(logging.WARNING)
logging.getLogger("py2neo.cypher").setLevel(logging.WARNING)
1
votes

If you are talking about running Graph.create from a Python console then the value you see is the return value from the method, not a log entry.

Note also that the logging setting you refer to is for the server, not the driver.

0
votes

This works for me.

http://py2neo.org/v3/database.html?highlight=relation

logging.getLogger("neo4j").setLevel(logging.WARNING)
logging.getLogger("httpstream").setLevel(logging.WARNING)