Readonly
Optional
A list of log levels to log or a custom logger function.
Currently there's only two levels: query and error. This will be expanded based on user feedback later.
query
error
const db = new Kysely<Database>({ dialect: new PostgresDialect(postgresConfig), log: ['query', 'error']}) Copy
const db = new Kysely<Database>({ dialect: new PostgresDialect(postgresConfig), log: ['query', 'error']})
const db = new Kysely<Database>({ dialect: new PostgresDialect(postgresConfig), log(event): void { if (event.level === 'query') { console.log(event.query.sql) console.log(event.query.parameters) } }}) Copy
const db = new Kysely<Database>({ dialect: new PostgresDialect(postgresConfig), log(event): void { if (event.level === 'query') { console.log(event.query.sql) console.log(event.query.parameters) } }})
Generated using TypeDoc
A list of log levels to log or a custom logger function.
Currently there's only two levels:
query
anderror
. This will be expanded based on user feedback later.Examples