If you face issues with the official Javascript driver and want to enable driver logging as you suspect issues at Bolt protocol level you can use the following additional logging function
See the example below for how to use it within your code.
import neo4j from "neo4j-driver";
// Configuring the driver
const driver = neo4j.driver(
'neo4j://localhost:7687',
neo4j.auth.basic('neo4j', 'pass'),
{
// The logging block code
logging: {
// setting the logging level to debug, possible options 'debug', 'info', 'warn', 'error'
level: 'debug',
// the logger function. It will receive log level and the message to be logged.
logger: (level, message) => {
console[level].call(console, `${level.toUpperCase()} ${message}`)
}
}
});
// Running some code
const session = driver.session()
const records = session.run('RETURN 1').then(r => r.records)
Comments
0 comments
Please sign in to leave a comment.