Migliorie log4j
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
2025-03-13 18:35:40 +01:00
parent 4e72e646de
commit e1e19b49c2
2 changed files with 11 additions and 8 deletions

View File

@@ -32,6 +32,7 @@ import it.integry.ems.service.dto.AttachmentDTO;
import it.integry.ems.service.dto.EntityFieldDTO;
import it.integry.ems.settings.Model.AvailableConnectionsModel;
import it.integry.ems.settings.Model.SettingsModel;
import it.integry.ems.settings.SettingsController;
import it.integry.ems.sync.MultiDBTransaction.AdvancedDataSource;
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
import it.integry.ems.utility.UtilityDebug;
@@ -127,6 +128,9 @@ public class EmsServices {
@Autowired
private MimeTypesHandler mimetypesFileTypeMap;
@Autowired
private SettingsController settingsController;
public EntityImportResponse<List<EntityBase>> importEntity(String type, String format, ImportRequestDTO body, boolean headless) throws Exception {
logger.debug("Starting import [Type: " + type + ", Format: " + format + "]");
String gestName = "IMPORT_" + type;
@@ -826,7 +830,9 @@ public class EmsServices {
if (UtilityDebug.isDebugExecution() || UtilityDebug.isIntegryServer())
throw new Exception("Cannot export server info in DEBUG mode");
List<AvailableConnectionsModel> availableConnectionList = settingsModel.getAvailableConnections(true);
List<AvailableConnectionsModel> availableConnectionList =
settingsModel.getAvailableConnectionsWithoutDuplicatedProfiles(true, settingsController.getHistoryProfileDb());
for (AvailableConnectionsModel model : availableConnectionList) {
try {
@@ -853,10 +859,6 @@ public class EmsServices {
try {
Properties jvmProperties = System.getProperties();
// String tomcatBase = jvmProperties.getProperty("catalina.base");
// String warPath = String.format("%s/webapps/ems-api.war", tomcatBase);
// File warFile = new File(warPath);
String domainname = System.getenv("USERDOMAIN");
arguments.put("domainName", domainname);
@@ -998,9 +1000,10 @@ public class EmsServices {
List<AdvancedDataSource> db =
Stream.of(data.getActiveConnections())
data.getActiveConnections().stream()
.filter(x -> UtilityString.equalsIgnoreCase(x.getDataSource().getProfile(), x.getDataSource().getDbName()) &&
x.isInternalDb()).toList();
x.isInternalDb())
.collect(Collectors.toList());
for (AdvancedDataSource dataSource : db) {
HashMap<String, Object> resultDbInfo = UtilityDB.executeSimpleQueryOnlyFirstRow(dataSource.getConnection(), sql);

View File

@@ -6,7 +6,7 @@
<Property name="logPattern">%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1.1.9}.java:%L %X{username} - %m%n</Property>
<!-- Enhanced pattern to better show DEBUG information -->
<Property name="consolePattern">
[%highlight{%-5level}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=black, DEBUG=green bold, TRACE=blue}] %d{yyyy-MM-dd HH:mm:ss} %style{%c{1.}}{cyan}: %msg%n%throwable
%d{yyyy-MM-dd HH:mm:ss} %style{%-40c{1.}}{cyan} %highlight{ %.-1p }{FATAL=bg_red blink black bold, ERROR=bg_red black, WARN=bright bg_yellow black, INFO=bg_green, DEBUG=bg_cyan black, TRACE=bg_white black} %highlight{%msg%n%throwable}{FATAL=red blink bold, ERROR=red, WARN=bright yellow, INFO=green, DEBUG=cyan, TRACE=white}
</Property>
</Properties>