Skip to content

Commit

Permalink
Document Bolt logger usage for ExecuteQuery (#505)
Browse files Browse the repository at this point in the history
Fixes #504

Co-authored-by: Stephen Cathcart <stephen.cathcart@neotechnology.com>
  • Loading branch information
fbiville and StephenCathcart authored Jul 19, 2023
1 parent 4147ce6 commit 6964030
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,13 @@ This is **disabled** by default.
For simplicity, we provide a predefined console logger which can be constructed by `neo4j.ConsoleBoltLogger`.

```go
session := driver.NewSession(neo4j.SessionConfig{
BoltLogger: neo4j.ConsoleBoltLogger(),
})
defer session.Close()
// [...]
boltLogger := neo4j.ConsoleBoltLogger()

# for ExecuteQuery
result, err := neo4j.ExecuteQuery(ctx, driver, query, params, transformer, neo4j.ExecuteQueryWithBoltLogger(boltLogger))

# for the regular session APIs (session.Run, session.BeginTransaction, session.ExecuteRead, session.ExecuteWrite)
session := driver.NewSession(neo4j.SessionConfig{BoltLogger: boltLogger})
```

### Custom Bolt Logger
Expand Down

0 comments on commit 6964030

Please sign in to comment.