2

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.

NumenorForLife
  • 1,736
  • 8
  • 27
  • 55

4 Answers4

6

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)
Community
  • 1
  • 1
user799188
  • 13,965
  • 5
  • 35
  • 37
1

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.

Nigel Small
  • 4,475
  • 1
  • 17
  • 15
0

This works for me.

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

logging.getLogger("neo4j").setLevel(logging.WARNING)
logging.getLogger("httpstream").setLevel(logging.WARNING)
nguaman
  • 925
  • 1
  • 9
  • 23
0

this work for me!

logging.getLogger("py2neo").setLevel(logging.WARNING)