mirror of https://github.com/vapor/docs.git
Add query logging note
This commit is contained in:
parent
5ba5079fdd
commit
27b8e8761d
|
|
@ -578,6 +578,18 @@ A key-path to the `@Children` relation is passed to `with` to tell Fluent to aut
|
|||
]
|
||||
```
|
||||
|
||||
## Query Logging
|
||||
|
||||
The Fluent drivers log the generated SQL at the debug log level. Some drivers, like FluentPostgreSQL, allow this to be configured when you configure the database.
|
||||
|
||||
To set the log level, in **configure.swift** (or where you set up your application) add:
|
||||
|
||||
```swift
|
||||
app.logger.logLevel = .debug
|
||||
```
|
||||
|
||||
This sets the log level to debug. When you next build and run your app, the SQL statements generated by Fluent will be logged to the console.
|
||||
|
||||
## Next steps
|
||||
|
||||
Congratulations on creating your first models and migrations and performing basic create and read operations. For more in-depth information on all of these features, check out their respective sections in the Fluent guide.
|
||||
|
|
|
|||
Loading…
Reference in New Issue