IDEMPIERE-6128 make org.idempiere.db.debug show just native Postgresql by default (#2335)

This commit is contained in:
Carlos Ruiz 2024-04-26 14:47:32 +02:00
parent 44688e37a1
commit f82c6a9468
2 changed files with 11 additions and 2 deletions

View File

@ -47,6 +47,7 @@ public class SystemProperties {
private static final String org_adempiere_po_useTimeoutForUpdate = "org.adempiere.po.useTimeoutForUpdate";
private static final String org_compiere_report_path = "org.compiere.report.path";
private static final String org_idempiere_db_debug = "org.idempiere.db.debug";
private static final String org_idempiere_db_debug_convert = "org.idempiere.db.debug.convert";
private static final String org_idempiere_db_debug_filter = "org.idempiere.db.debug.filter";
private static final String org_idempiere_FileLogPrefix = "org.idempiere.FileLogPrefix";
private static final String org_idempiere_postgresql_URLParameters = "org.idempiere.postgresql.URLParameters";
@ -178,6 +179,14 @@ public class SystemProperties {
return System.getProperty(org_idempiere_db_debug_filter);
}
/**
* org.idempiere.db.convert=true to print also Oracle SQL Statements being converted
* @return
*/
public static boolean isDBDebugConvert() {
return "true".equals(System.getProperty(org_idempiere_db_debug_convert));
}
/**
* org.idempiere.FileLogPrefix defines the template prefix to write logs
* @return

View File

@ -148,9 +148,9 @@ public class Convert_PostgreSQL extends Convert_SQL92 {
boolean print = true;
if (filterPgDebug != null)
print = statement.matches(filterPgDebug);
// log.warning("Oracle -> " + oraStatement);
if (print) {
log.warning("Oracle -> " + sqlStatement);
if (SystemProperties.isDBDebugConvert())
log.warning("Oracle -> " + sqlStatement);
log.warning("PgSQL -> " + statement);
}
}