informational message from database logged at WARN level #774
Comments
I'm attempting to test a patch but the documented way of omitting commercial databases doesn't seem to work. I tried |
Since I can't build against master, I forked flyway-3.0 and applied a patch. It seems to be correctly logging information messages at the INFO level with my software. I'll paste the patch here. Feel free to apply it. I can submit a pull request once it is possible to build master again.
|
PostgreSQL causes SQLWarnings when DDL statements have side-effects. In these cases, the SQLState and ErrorCode are both zero. According to SQL-92, a SQLState of 00 means success.
Since All SQLWarning objects are logged by flyway at the WARN level, it makes it difficult to filter out non-errors and appears confusing to end-users. Logging successful states at the INFO level would be more helpful.
The relevant logging code is in org.flywaydb.core.internal.dbsupport.JdbcTemplate.executeStatement()
Reproduction:
v_1__foo.sql:
CREATE TABLE foo (id int);
ALTER TABLE foo ADD CONSTRAINT foo_pkey PRIMARY KEY (id);
log message:
WARN o.f.c.i.dbsupport.JdbcTemplate - ALTER TABLE / ADD PRIMARY KEY will create implicit index "foo_pkey" for table "foo" (SQL State: 00000 - Error Code: 0)
The text was updated successfully, but these errors were encountered: