change logging during upgrade (#5474)

* reduce ERROR logging on ignored exception

* string concat formatting

Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>

Co-authored-by: Daan Hoogland <dahn@onecht.net>
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
This commit is contained in:
dahn 2021-09-20 18:00:06 +02:00 committed by GitHub
parent 20d5bf55b7
commit 22a0c0a46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 3 deletions

View File

@ -2388,19 +2388,32 @@ public class Upgrade410to420 implements DbUpgrade {
conn.prepareStatement("ALTER TABLE `cloud`.`volumes` CHANGE COLUMN `iso_id1` `iso_id` bigint(20) unsigned COMMENT 'The id of the iso from which the volume was created'");) {
alter_iso_pstmt.executeUpdate();
}catch (SQLException e) {
s_logger.error("migrateDatafromIsoIdInVolumesTable:Exception:"+e.getMessage(),e);
s_logger.info("migrateDatafromIsoIdInVolumesTable: ignoring Exception: " + e.getMessage());
if (s_logger.isTraceEnabled()) {
s_logger.trace("migrateDatafromIsoIdInVolumesTable: ignored Exception",e);
}
//implies iso_id1 is not present, so do nothing.
}
}catch (SQLException e) {
s_logger.error("migrateDatafromIsoIdInVolumesTable:Exception:"+e.getMessage(),e);
s_logger.info("migrateDatafromIsoIdInVolumesTable: ignoring Exception: " + e.getMessage());
if (s_logger.isTraceEnabled()) {
s_logger.trace("migrateDatafromIsoIdInVolumesTable: ignored Exception",e);
}
//implies iso_id1 is not present, so do nothing.
}
}
}catch (SQLException e) {
s_logger.error("migrateDatafromIsoIdInVolumesTable:Exception:"+e.getMessage(),e);
s_logger.info("migrateDatafromIsoIdInVolumesTable: ignoring Exception: " + e.getMessage());
if (s_logger.isTraceEnabled()) {
s_logger.trace("migrateDatafromIsoIdInVolumesTable: ignored Exception",e);
}
//implies iso_id1 is not present, so do nothing.
}
} catch (SQLException e) {
s_logger.info("migrateDatafromIsoIdInVolumesTable: ignoring Exception: " + e.getMessage());
if (s_logger.isTraceEnabled()) {
s_logger.trace("migrateDatafromIsoIdInVolumesTable: ignored Exception",e);
}
//implies iso_id1 is not present, so do nothing.
}
}