From c707b352fdd5f0626a4b484765b9fe0ef845ccec Mon Sep 17 00:00:00 2001 From: Misagh Moayyed Date: Mon, 5 Mar 2018 16:13:57 +0100 Subject: [PATCH] fix logger parameter placeholders --- .../web/component/input/ExpressionValuePanel.java | 4 ++-- .../web/page/admin/resources/ResourceContentPanel.java | 2 +- .../midpoint/web/page/self/PageAccountActivation.java | 2 +- .../com/evolveum/midpoint/common/crypto/CryptoUtil.java | 6 +++--- .../com/evolveum/midpoint/prism/schema/SchemaHandler.java | 4 ++-- .../java/com/evolveum/midpoint/test/util/TestUtil.java | 4 ++-- .../java/com/evolveum/midpoint/util/ClassPathUtil.java | 2 +- .../script/xpath/ReflectionXPathFunctionWrapper.java | 2 +- .../midpoint/model/common/mapping/MappingImpl.java | 2 +- .../impl/controller/ModelInteractionServiceImpl.java | 4 ++-- .../midpoint/model/impl/expr/MidpointFunctionsImpl.java | 2 +- .../midpoint/model/impl/lens/IvwoConsolidator.java | 4 ++-- .../midpoint/model/impl/lens/PersonaProcessor.java | 2 +- .../impl/lens/projector/ReconciliationProcessor.java | 4 ++-- .../impl/lens/projector/focus/AssignmentProcessor.java | 2 +- .../lens/projector/focus/FocusLifecycleProcessor.java | 2 +- .../model/impl/lens/projector/focus/InboundProcessor.java | 2 +- .../model/impl/scripting/ScriptExecutionTaskHandler.java | 2 +- .../model/impl/scripting/actions/RecomputeExecutor.java | 2 +- .../midpoint/model/impl/security/WsFaultListener.java | 4 ++-- .../model/impl/sync/ReconciliationTaskHandler.java | 4 ++-- .../midpoint/model/impl/util/DeleteTaskHandler.java | 4 ++-- .../impl/ChangeNotificationDispatcherImpl.java | 8 ++++---- .../provisioning/impl/ProvisioningServiceImpl.java | 8 ++++---- .../midpoint/provisioning/impl/ResourceManager.java | 3 ++- .../provisioning/impl/ResourceObjectConverter.java | 4 ++-- .../evolveum/midpoint/provisioning/impl/ShadowCache.java | 2 +- .../midpoint/provisioning/impl/ShadowManager.java | 3 +-- .../midpoint/provisioning/ucf/impl/connid/ConnIdUtil.java | 4 ++-- .../ucf/impl/connid/ConnectorFactoryConnIdImpl.java | 3 +-- .../repo/common/commandline/CommandLineRunner.java | 2 +- .../midpoint/repo/common/expression/Expression.java | 2 +- .../com/evolveum/midpoint/repo/sql/OperationLogger.java | 2 +- .../evolveum/midpoint/repo/sql/SqlRepositoryFactory.java | 2 +- .../security/enforcer/impl/SecurityEnforcerImpl.java | 2 +- 35 files changed, 55 insertions(+), 56 deletions(-) diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java index 2b640849035..012dc0027f1 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/input/ExpressionValuePanel.java @@ -263,7 +263,7 @@ protected ObjectQuery getChooseQuery() { query.setFilter(filter); } } catch (SchemaException ex) { - LOGGER.error("Couldn't create query filter for ShadowType popup list" , ex.getErrorTypeMessage()); + LOGGER.error("Couldn't create query filter for ShadowType popup list: {}" , ex.getErrorTypeMessage()); } return query; } @@ -431,7 +431,7 @@ private List getLiteralValues(){ try{ return ExpressionUtil.getLiteralExpressionValues(getModelObject()); } catch (SchemaException ex){ - LOGGER.error("Couldn't get literal expression value, ", ex.getLocalizedMessage()); + LOGGER.error("Couldn't get literal expression value: {}", ex.getLocalizedMessage()); } return literalValueList; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceContentPanel.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceContentPanel.java index eec015ca050..4e724b35479 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceContentPanel.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/resources/ResourceContentPanel.java @@ -475,7 +475,7 @@ private List getTasksForKind(List> tasks) { .findProperty(new ItemPath(TaskType.F_EXTENSION, SchemaConstants.OBJECTCLASS_PROPERTY_NAME)); if (taskObjectClass == null) { - LOGGER.warn("Bad task definition. Task {} doesn't contain definition either of objectClass or kind/intent"); + LOGGER.warn("Bad task definition. Task {} doesn't contain definition either of objectClass or kind/intent", task.getOid()); continue; } diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAccountActivation.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAccountActivation.java index 34c1a859492..c1dc5cdff51 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAccountActivation.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/self/PageAccountActivation.java @@ -252,7 +252,7 @@ private void propagatePassword(AjaxRequestTarget target, try { token = authenticationEvaluator.authenticate(connEnv, new PasswordAuthenticationContext(userModel.getObject().getName().getOrig(), value)); } catch (Exception ex) { - LOGGER.error("Failed to authenticate user, reason ", ex.getMessage()); + LOGGER.error("Failed to authenticate user, reason {}", ex.getMessage()); getSession().error(getString("PageAccountActivation.authentication.failed")); throw new RestartResponseException(PageAccountActivation.class, getPageParameters()); } diff --git a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java index ba38d3899a7..6672cb33b10 100644 --- a/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java +++ b/infra/common/src/main/java/com/evolveum/midpoint/common/crypto/CryptoUtil.java @@ -274,7 +274,7 @@ public static void securitySelfTest(OperationResult parentTestResult) { providerResult.addContext("properties", propXml); providerResult.recordSuccess(); } catch (Throwable e) { - LOGGER.error("Security self test (provider properties) failed: ", e.getMessage() ,e); + LOGGER.error("Security self test (provider properties) failed: {}", e.getMessage() ,e); providerResult.recordFatalError(e); } } @@ -341,11 +341,11 @@ private static void securitySelfTestAlgorithm(String algorithmName, String trans new Object[] {algorithmName, transformationName, keySize}); } catch (Throwable e) { if (critical) { - LOGGER.error("Security self test (algorithmName={}, transformationName={}, keySize={}) failed: {}", + LOGGER.error("Security self test (algorithmName={}, transformationName={}, keySize={}) failed: {}-{}", new Object[] {algorithmName, transformationName, keySize, e.getMessage() ,e}); subresult.recordFatalError(e); } else { - LOGGER.warn("Security self test (algorithmName={}, transformationName={}, keySize={}) failed: {} (failure is expected in some cases)", + LOGGER.warn("Security self test (algorithmName={}, transformationName={}, keySize={}) failed: {}-{} (failure is expected in some cases)", new Object[] {algorithmName, transformationName, keySize, e.getMessage() ,e}); subresult.recordWarning(e); } diff --git a/infra/prism/src/main/java/com/evolveum/midpoint/prism/schema/SchemaHandler.java b/infra/prism/src/main/java/com/evolveum/midpoint/prism/schema/SchemaHandler.java index ec68bdd03d6..108fa2bf1bd 100644 --- a/infra/prism/src/main/java/com/evolveum/midpoint/prism/schema/SchemaHandler.java +++ b/infra/prism/src/main/java/com/evolveum/midpoint/prism/schema/SchemaHandler.java @@ -93,11 +93,11 @@ public InputSource resolveEntity(String publicId, String systemId) throws SAXExc LOGGER.trace("Resolved entity '{}', '{}': '{}' (resolver: {})", new Object[] { publicId, systemId, source, entityResolver}); return source; } catch (SAXException e) { - LOGGER.error("XML error resolving entity '{}', '{}': '{}'", + LOGGER.error("XML error resolving entity '{}', '{}': '{}-{}'", new Object[] { publicId, systemId, e.getMessage(), e }); throw e; } catch (IOException e) { - LOGGER.error("IO error resolving entity '{}', '{}': '{}'", + LOGGER.error("IO error resolving entity '{}', '{}': '{}-{}'", new Object[] { publicId, systemId, e.getMessage(), e }); throw e; } diff --git a/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/TestUtil.java b/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/TestUtil.java index ed65649281c..2b3e14d4e7f 100644 --- a/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/TestUtil.java +++ b/infra/test-util/src/main/java/com/evolveum/midpoint/test/util/TestUtil.java @@ -171,8 +171,8 @@ public static void assertElement(List elements, QName elementQName, Stri } public static void assertExceptionSanity(ObjectAlreadyExistsException e) { - LOGGER.debug("Excpetion (expected)", e, e); - System.out.println("Excpetion (expected)"); + LOGGER.debug("Exception (expected) {}", e, e); + System.out.println("Exception (expected)"); System.out.println(ExceptionUtils.getFullStackTrace(e)); assert !e.getMessage().isEmpty() : "Empty exception message"; assert e.getMessage().length() < MAX_EXCEPTION_MESSAGE_LENGTH : "Exception message too long (" diff --git a/infra/util/src/main/java/com/evolveum/midpoint/util/ClassPathUtil.java b/infra/util/src/main/java/com/evolveum/midpoint/util/ClassPathUtil.java index ff0949b55cf..3dc080d693d 100644 --- a/infra/util/src/main/java/com/evolveum/midpoint/util/ClassPathUtil.java +++ b/infra/util/src/main/java/com/evolveum/midpoint/util/ClassPathUtil.java @@ -204,7 +204,7 @@ public static boolean extractFilesFromClassPath(String srcPath, String dstPath, // skip other files if (!jarEntry.getName().contains(srcPath)) { - LOGGER.trace("Not relevant: ", jarEntry.getName()); + LOGGER.trace("Not relevant: {}", jarEntry.getName()); continue; } diff --git a/model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/xpath/ReflectionXPathFunctionWrapper.java b/model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/xpath/ReflectionXPathFunctionWrapper.java index 6ad647812ac..d3a1622b3ee 100644 --- a/model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/xpath/ReflectionXPathFunctionWrapper.java +++ b/model/model-common/src/main/java/com/evolveum/midpoint/model/common/expression/script/xpath/ReflectionXPathFunctionWrapper.java @@ -68,7 +68,7 @@ public Object evaluate(List argList) throws XPathFunctionException { } catch (InvocationTargetException e) { throw new XPathFunctionException(e); } catch (NoSuchMethodException e) { - LOGGER.error("Cannot find {} function with {} arguments", new Object[]{functionName, arity, e}); + LOGGER.error("Cannot find {} function with {} arguments: {}", new Object[]{functionName, arity, e}); throw new XPathFunctionException(e); } diff --git a/model/model-common/src/main/java/com/evolveum/midpoint/model/common/mapping/MappingImpl.java b/model/model-common/src/main/java/com/evolveum/midpoint/model/common/mapping/MappingImpl.java index a5c2e96dd58..790ac42706d 100644 --- a/model/model-common/src/main/java/com/evolveum/midpoint/model/common/mapping/MappingImpl.java +++ b/model/model-common/src/main/java/com/evolveum/midpoint/model/common/mapping/MappingImpl.java @@ -635,7 +635,7 @@ private void traceNotApplicable(String reason) { } private void traceFailure(Throwable e) { - LOGGER.error("Error evaluating {}: {}", new Object[]{getMappingContextDescription(), e.getMessage(), e}); + LOGGER.error("Error evaluating {}: {}-{}", new Object[]{getMappingContextDescription(), e.getMessage(), e}); traceEvaluationEnd(); if (!isTrace()) { return; diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java index e0387cafe69..7f676c8dfa1 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelInteractionServiceImpl.java @@ -424,7 +424,7 @@ public RefinedObjectClassDefinition getEditObjectClassDefinition(PrismObject void generateValue(PrismObject object, PolicyIt generateValue(object, valuePolicy, policyItemDefinition, task, generateValueResult); } catch (ExpressionEvaluationException | SchemaException | ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException e) { - LOGGER.error("Failed to generate value for {} " + policyItemDefinition, e); + LOGGER.error("Failed to generate value for {} ", policyItemDefinition, e); generateValueResult.recordFatalError("Failed to generate value for " + policyItemDefinition + ". Reason: " + e.getMessage(), e); policyItemDefinition.setResult(generateValueResult.createOperationResultType()); continue; diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.java index b6da7c9f1c4..3bd3a065ca8 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/expr/MidpointFunctionsImpl.java @@ -1345,7 +1345,7 @@ public Map parseXmlToMap(String xml) { value = null; } } else { - LOGGER.trace("No value between xml tags, tag name : {0}", endName); + LOGGER.trace("No value between xml tags, tag name : {}", endName); } } else if (code == XMLStreamConstants.END_DOCUMENT) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/IvwoConsolidator.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/IvwoConsolidator.java index 1dce4aa13c6..94c785be20f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/IvwoConsolidator.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/IvwoConsolidator.java @@ -173,7 +173,7 @@ public void setStrengthSelector(StrengthSelector strengthSelector) { @NotNull public ItemDelta consolidateToDelta() throws ExpressionEvaluationException, PolicyViolationException, SchemaException { if (strengthSelector.isNone()) { - LOGGER.trace("Consolidation of {} skipped as strength selector is 'none'"); + LOGGER.trace("Consolidation of {} skipped as strength selector is 'none'", itemPath); return null; } @@ -350,7 +350,7 @@ public ItemDelta consolidateToDelta() throws ExpressionEvaluationException, if (weakOnly && !strengthSelector.isWeak() && (itemExisting == null || itemExisting.isEmpty())){ // There is a weak mapping on a property, but we do not have full account available, so skipping deletion of the value is better way - LOGGER.trace("Value {} mapping is weak and the full account could not be fetched, skipping deletion in {}", + LOGGER.trace("Value {} mapping is weak and the full account could not be fetched, skipping deletion in {} with context {}", value, itemPath, contextDescription); continue; } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/PersonaProcessor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/PersonaProcessor.java index 410dc96e324..df09c5a270d 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/PersonaProcessor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/PersonaProcessor.java @@ -340,7 +340,7 @@ public void personaDelete(LensContext context, PersonaK throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException, PreconditionViolationException { PrismObject focus = context.getFocusContext().getObjectOld(); - LOGGER.debug("Deleting persona {} for {}: ", key, focus, existingPersona); + LOGGER.debug("Deleting persona {} for {}: {}", key, focus, existingPersona); ObjectDelta targetDelta = existingPersona.asPrismObject().createDeleteDelta(); executePersonaDelta(targetDelta, task, result); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/ReconciliationProcessor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/ReconciliationProcessor.java index 3a3ccd29004..ee229f7f5d7 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/ReconciliationProcessor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/ReconciliationProcessor.java @@ -1014,13 +1014,13 @@ private boolean isToBeDeleted(ItemDelta existingDelta, ValueMatcher valueMat if (isInDeltaValue instanceof PrismPropertyValue){ PrismPropertyValue isInRealValue = (PrismPropertyValue) isInDeltaValue; if (matchValue(isInRealValue.getValue(), value, valueMatcher)) { - LOGGER.trace("Skipping adding value {} to delta for DELETE because it's already there"); + LOGGER.trace("Skipping adding value {} to delta for DELETE because it's already there", value); return true; } } else if (isInDeltaValue instanceof PrismContainerValue) { PrismContainerValue isInRealValue = (PrismContainerValue) isInDeltaValue; if (matchValue(isInRealValue.asContainerable(), value, valueMatcher)){ - LOGGER.trace("Skipping adding value {} to delta for DELETE because it's already there"); + LOGGER.trace("Skipping adding value {} to delta for DELETE because it's already there", value); return true; } } //TODO: reference delta??? diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentProcessor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentProcessor.java index b9f4f71e747..a41a6b3808a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentProcessor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/AssignmentProcessor.java @@ -325,7 +325,7 @@ public boolean before(ResourceShadowDiscriminator rat) { if (SchemaConstants.CHANGE_CHANNEL_DISCOVERY.equals(QNameUtil.uriToQName(context.getChannel()))) { LOGGER.trace( - "Processing of shadow identified by {} will be skipped because of limitation for discovery channel."); // TODO is this message OK? [med] + "Processing of shadow identified by {} will be skipped because of limitation for discovery channel.", context.getChannel()); // TODO is this message OK? [med] processOnlyExistingProjCxts = true; } } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/FocusLifecycleProcessor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/FocusLifecycleProcessor.java index 3c0e4f8d145..72f2e8d15aa 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/FocusLifecycleProcessor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/FocusLifecycleProcessor.java @@ -138,7 +138,7 @@ private void processLifecycleWithFocus(LensContext cont LOGGER.debug("Lifecycle state transition of {}: {} -> {}", objectNew, startLifecycleState, targetLifecycleState); recordLifecycleTransitionDelta(focusContext, targetLifecycleState); executeEntryActions(context, lifecycleStateModel, targetLifecycleState, now, task, result); - LOGGER.trace("Lifecycle state transition of {} to {} done", objectNew, startLifecycleState, targetLifecycleState); + LOGGER.trace("Lifecycle state transition of {} from {} to {} done", objectNew, startLifecycleState, targetLifecycleState); break; } } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/InboundProcessor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/InboundProcessor.java index 60ebf732134..c157bd047fd 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/InboundProcessor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/projector/focus/InboundProcessor.java @@ -563,7 +563,7 @@ private bo } private void resolveEntitlement(PrismContainerValue value, LensProjectionContext projContext, ExpressionVariables variables) { - LOGGER.trace("Producing value {} " + value); + LOGGER.trace("Producing value {} ", value); PrismObject entitlement = projContext.getEntitlementMap().get(value.findReference(ShadowAssociationType.F_SHADOW_REF).getOid()); LOGGER.trace("Resolved entitlement {}", entitlement); if (variables.containsKey(ExpressionConstants.VAR_ENTITLEMENT)) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java index 229636f9288..bf42f68a7f9 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/ScriptExecutionTaskHandler.java @@ -81,7 +81,7 @@ public TaskRunResult run(Task task) { try { ScriptExecutionResult executionResult = scriptingService.evaluateExpression(executeScriptProperty.getRealValue(), emptyMap(), task, result); LOGGER.debug("Execution output: {} item(s)", executionResult.getDataOutput().size()); - LOGGER.debug("Execution result:\n", executionResult.getConsoleOutput()); + LOGGER.debug("Execution result:\n{}", executionResult.getConsoleOutput()); result.computeStatus(); runResult.setRunResultStatus(TaskRunResult.TaskRunResultStatus.FINISHED); } catch (ScriptExecutionException | SecurityViolationException | SchemaException | ObjectNotFoundException | ExpressionEvaluationException | CommunicationException | ConfigurationException e) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/RecomputeExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/RecomputeExecutor.java index c3ecc2408f9..b33d3951ed3 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/RecomputeExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/actions/RecomputeExecutor.java @@ -76,7 +76,7 @@ public PipelineData execute(ActionExpressionType expression, PipelineData input, Throwable exception = null; try { if (LOGGER.isTraceEnabled()) { - LOGGER.trace("Recomputing object {} with dryRun={}: context:\n{}", focalPrismObject, dryRun); + LOGGER.trace("Recomputing object {} with dryRun={}", focalPrismObject, dryRun); } ObjectDelta emptyDelta = ObjectDelta.createEmptyDelta(focusType.getClass(), focusType.getOid(), prismContext, ChangeType.MODIFY); operationsHelper.applyDelta(emptyDelta, ModelExecuteOptions.createReconcile(), dryRun, context, result); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/WsFaultListener.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/WsFaultListener.java index 06939bc3018..da0a9856c15 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/WsFaultListener.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/security/WsFaultListener.java @@ -39,7 +39,7 @@ public WsFaultListener(SecurityHelper securityHelper) { @Override public boolean faultOccurred(Exception exception, String description, Message message) { - LOGGER.trace("Handling fault: {}: {} - {}", new Object[]{exception, description, message, exception}); + LOGGER.trace("Handling fault: {}: {} - {}-{}", new Object[]{exception, description, message, exception}); Object audited = message.getContextualProperty(SecurityHelper.CONTEXTUAL_PROPERTY_AUDITED_NAME); if (audited != null && ((Boolean)audited)) { return true; @@ -74,4 +74,4 @@ public boolean faultOccurred(Exception exception, String description, Message me } -} \ No newline at end of file +} diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java index 1a902fe2389..3a35afc7b64 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/sync/ReconciliationTaskHandler.java @@ -394,7 +394,7 @@ private void processInterruption(TaskRunResult runResult, PrismObject resource, Task task, OperationResult opResult) { String message = errorDesc+": "+ex.getMessage(); - LOGGER.error("Reconciliation: {}", new Object[]{message, ex}); + LOGGER.error("Reconciliation: {}-{}", new Object[]{message, ex}); opResult.recordFatalError(message, ex); TaskHandlerUtil.appendLastFailuresInformation(OperationConstants.RECONCILIATION, task, opResult); // TODO implement more seriously runResult.setRunResultStatus(runResultStatus); @@ -414,7 +414,7 @@ private void processErrorPartial(TaskRunResult runResult, String errorDesc, Exce } else { message = errorDesc+": "+ex.getMessage(); } - LOGGER.error("Reconciliation: {}", new Object[]{message, ex}); + LOGGER.error("Reconciliation: {}-{}", new Object[]{message, ex}); opResult.recordFatalError(message, ex); runResult.setRunResultStatus(runResultStatus); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java index d351b8f586d..d7c58ccb784 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/util/DeleteTaskHandler.java @@ -144,7 +144,7 @@ private TaskRunResult runInternal(Task task) { LOGGER.trace("Using object query from the task: {}", query.debugDump()); } } catch (SchemaException ex) { - LOGGER.error("Schema error while creating a search filter: {}", new Object[]{ex.getMessage(), ex}); + LOGGER.error("Schema error while creating a search filter: {}-{}", new Object[]{ex.getMessage(), ex}); opResult.recordFatalError("Schema error while creating a search filter: " + ex.getMessage(), ex); runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); return runResult; @@ -244,7 +244,7 @@ && isTrue(((ShadowType)(object.asObjectable())).isProtectedObject())) { runResult.setRunResultStatus(TaskRunResultStatus.PERMANENT_ERROR); return runResult; } catch (CommunicationException e) { - LOGGER.error("{}", new Object[]{e.getMessage(), e}); + LOGGER.error("{}-{}", new Object[]{e.getMessage(), e}); opResult.recordFatalError("Object not found " + e.getMessage(), e); runResult.setRunResultStatus(TaskRunResultStatus.TEMPORARY_ERROR); return runResult; diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java index 2d79ee8fdc1..1fc434f6c2c 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ChangeNotificationDispatcherImpl.java @@ -176,7 +176,7 @@ public void notifyFailure(ResourceOperationDescription failureDescription, try { listener.notifyFailure(failureDescription, task, parentResult); } catch (RuntimeException e) { - LOGGER.error("Exception {} thrown by operation failure listener {}: {}", new Object[]{ + LOGGER.error("Exception {} thrown by operation failure listener {}: {}-{}", new Object[]{ e.getClass(), listener.getName(), e.getMessage(), e }); parentResult.createSubresult(CLASS_NAME_WITH_DOT + "notifyFailure").recordWarning("Operation failure listener has thrown unexpected exception", e); } @@ -206,7 +206,7 @@ public void notifySuccess(ResourceOperationDescription failureDescription, try { listener.notifySuccess(failureDescription, task, parentResult); } catch (RuntimeException e) { - LOGGER.error("Exception {} thrown by operation success listener {}: {}", new Object[]{ + LOGGER.error("Exception {} thrown by operation success listener {}: {}-{}", new Object[]{ e.getClass(), listener.getName(), e.getMessage(), e }); parentResult.createSubresult(CLASS_NAME_WITH_DOT + "notifySuccess").recordWarning("Operation success listener has thrown unexpected exception", e); } @@ -236,7 +236,7 @@ public void notifyInProgress(ResourceOperationDescription failureDescription, try { listener.notifyInProgress(failureDescription, task, parentResult); } catch (RuntimeException e) { - LOGGER.error("Exception {} thrown by operation in-progress listener {}: {}", new Object[]{ + LOGGER.error("Exception {} thrown by operation in-progress listener {}: {}-{}", new Object[]{ e.getClass(), listener.getName(), e.getMessage(), e }); parentResult.createSubresult(CLASS_NAME_WITH_DOT + "notifyInProgress").recordWarning("Operation in-progress listener has thrown unexpected exception", e); } @@ -279,7 +279,7 @@ public void notifyEvent(ResourceEventDescription eventDescription, try { listener.notifyEvent(eventDescription, task, parentResult); } catch (RuntimeException e) { - LOGGER.error("Exception {} thrown by event listener {}: {}", new Object[]{ + LOGGER.error("Exception {} thrown by event listener {}: {}-{}", new Object[]{ e.getClass(), listener.getName(), e.getMessage(), e }); parentResult.createSubresult(CLASS_NAME_WITH_DOT + "notifyEvent").recordWarning("Event listener has thrown unexpected exception", e); throw e; diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java index 34157f7a661..8815d01b7eb 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ProvisioningServiceImpl.java @@ -498,7 +498,7 @@ private SearchResultList> searchRepoObject // TODO: what else do to with objResult?? } catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | ExpressionEvaluationException e) { - LOGGER.error("Error while completing {}: {}. Using non-complete object.", new Object[] { + LOGGER.error("Error while completing {}: {}-{}. Using non-complete object.", new Object[] { repoObject, e.getMessage(), e }); objResult.recordFatalError(e); repoObject.asObjectable().setFetchResult(objResult.createOperationResultType()); @@ -514,7 +514,7 @@ private SearchResultList> searchRepoObject // ICF exceptions are still translated to system exceptions. // So this provides // a better robustness now. - LOGGER.error("System error while completing {}: {}. Using non-complete object.", new Object[] { + LOGGER.error("System error while completing {}: {}-{}. Using non-complete object.", new Object[] { repoObject, e.getMessage(), e }); objResult.recordFatalError(e); repoObject.asObjectable().setFetchResult(objResult.createOperationResultType()); @@ -890,7 +890,7 @@ public void refreshShadow(PrismObject shadow, ProvisioningOperationO result.computeStatus(); result.cleanupResult(); - LOGGER.debug("Finished refreshing shadow {}: ", shadow, result); + LOGGER.debug("Finished refreshing shadow {}: {}", shadow, result); } private void refreshShadowLegacy(PrismObject shadow, ProvisioningOperationOptions options, Task task, OperationResult result) @@ -925,7 +925,7 @@ private boolean handleRepoObject(final Class type, Pri completeObject = completeObject(type, object, options, task, objResult); } catch (SchemaException | ObjectNotFoundException | CommunicationException | ConfigurationException | ExpressionEvaluationException e) { - LOGGER.error("Error while completing {}: {}. Using non-complete object.", new Object[] { + LOGGER.error("Error while completing {}: {}-{}. Using non-complete object.", new Object[] { object, e.getMessage(), e }); objResult.recordFatalError(e); object.asObjectable().setFetchResult(objResult.createOperationResultType()); diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceManager.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceManager.java index 144f6a0b0be..c77953178be 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceManager.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceManager.java @@ -1158,7 +1158,8 @@ public void applyDefinition(ObjectDelta delta, ResourceType resour // Probably a malformed connector. To be kind of robust, lets allow the import. // Mark the error ... there is nothing more to do objectResult.recordPartialError("Connector (OID:" + connectorOid + ") referenced from the resource has schema problems: " + e.getMessage(), e); - LOGGER.error("Connector (OID:{}) referenced from the imported resource \"{}\" has schema problems: {}", new Object[]{connectorOid, resourceType.getName(), e.getMessage(), e}); + LOGGER.error("Connector (OID:{}) referenced from the imported resource \"{}\" has schema problems: {}-{}", + new Object[]{connectorOid, resourceType.getName(), e.getMessage(), e}); return; } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceObjectConverter.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceObjectConverter.java index a0d6dcdfd4f..36038426f24 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceObjectConverter.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ResourceObjectConverter.java @@ -465,7 +465,7 @@ public AsynchronousOperationReturnValue completeShadow(ProvisioningContext ctx, // Simply ignore this association value. parentResult.muteLastSubresultError(); LOGGER.warn( - "The entitlement identified by {} referenced from {} violates the schema. Skipping. Original error: {}", + "The entitlement identified by {} referenced from {} violates the schema. Skipping. Original error: {}-{}", new Object[] { associationCVal, resourceShadow, e.getMessage(), e }); continue; } diff --git a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java index 963072c1379..3704c530bb6 100644 --- a/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java +++ b/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/ShadowManager.java @@ -334,8 +334,7 @@ public PrismObject lookupShadowBySecondaryIdentifiers( return null; } if (shadows.size() > 1) { - LOGGER.error("Too many shadows ({}) for secondary identifiers {}: ", shadows.size(), secondaryIdentifiers, - shadows); + LOGGER.error("Too many shadows ({}) for secondary identifiers {}: {}", shadows.size(), secondaryIdentifiers, shadows); throw new ConfigurationException("Too many shadows ("+shadows.size()+") for secondary identifiers "+secondaryIdentifiers); } return shadows.get(0); diff --git a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdUtil.java b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdUtil.java index 2c673c70a37..d7038f80d9f 100644 --- a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdUtil.java +++ b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnIdUtil.java @@ -155,7 +155,7 @@ static Throwable processConnIdException(Throwable connIdException, String desc, RemoteWrappedException remoteWrappedException = (RemoteWrappedException) connIdException; String className = remoteWrappedException.getExceptionClass(); if (className == null) { - LOGGER.error("Remote ConnId exception without inner exception class name. Continuing with original one: {}", connIdException); + LOGGER.error("Remote ConnId exception without inner exception class name. Continuing with original one", connIdException); } else if (DOT_NET_ARGUMENT_EXCEPTION.equals(className) && remoteWrappedException.getMessage().contains("0x800708C5")) { // password too weak connIdException = new SecurityViolationException(connIdException.getMessage(), connIdException); } else { @@ -599,7 +599,7 @@ public static GuardedString toGuardedString(ProtectedStringType ps, String prope try { return new GuardedString(protector.decryptString(ps).toCharArray()); } catch (EncryptionException e) { - LOGGER.error("Unable to decrypt value of element {}: {}", + LOGGER.error("Unable to decrypt value of element {}: {}-{}", new Object[] { propertyName, e.getMessage(), e }); throw new SystemException("Unable to decrypt value of element " + propertyName + ": " + e.getMessage(), e); diff --git a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java index 8ad8f261a0f..ffe09c57d3f 100644 --- a/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java +++ b/provisioning/ucf-impl-connid/src/main/java/com/evolveum/midpoint/provisioning/ucf/impl/connid/ConnectorFactoryConnIdImpl.java @@ -696,7 +696,7 @@ private Boolean isThisBundleCompatible(URL bundleUrl) { } } catch (Exception ex) { if (LOGGER.isDebugEnabled()) { - LOGGER.error("Error instantiating ICF bundle using URL '{}': {}", new Object[] { bundleUrl, ex.getMessage(), ex}); + LOGGER.error("Error instantiating ICF bundle using URL '{}': {}-{}", new Object[] { bundleUrl, ex.getMessage(), ex}); } else { LOGGER.error("Error instantiating ICF bundle using URL '{}': {}", new Object[] { bundleUrl, ex.getMessage()}); } @@ -912,5 +912,4 @@ public void shutdown() { LOGGER.info("Shutting down ConnId framework"); ConnectorFacadeFactory.getInstance().dispose(); } - } diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/commandline/CommandLineRunner.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/commandline/CommandLineRunner.java index efad6926295..91d5ebbb6c5 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/commandline/CommandLineRunner.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/commandline/CommandLineRunner.java @@ -80,7 +80,7 @@ public void execute() throws IOException, InterruptedException { processBuilder.environment().putAll(env); } - LOGGER.debug("Starting process ", processBuilder.command()); + LOGGER.debug("Starting process {}", processBuilder.command()); Process process = processBuilder.start(); Integer exitValue = process.waitFor(); diff --git a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/Expression.java b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/Expression.java index c5cb979c523..449b61b5097 100644 --- a/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/Expression.java +++ b/repo/repo-common/src/main/java/com/evolveum/midpoint/repo/common/expression/Expression.java @@ -250,7 +250,7 @@ private void traceSuccess(ExpressionEvaluationContext context, ExpressionVariabl } private void traceFailure(ExpressionEvaluationContext context, ExpressionVariables processedVariables, Throwable e) { - LOGGER.error("Error evaluating expression in {}: {}", new Object[]{context.getContextDescription(), e.getMessage(), e}); + LOGGER.error("Error evaluating expression in {}: {}-{}", new Object[]{context.getContextDescription(), e.getMessage(), e}); if (!isTrace()) { return; } diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/OperationLogger.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/OperationLogger.java index 3e5f47ce4ca..d8d3896ee16 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/OperationLogger.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/OperationLogger.java @@ -64,7 +64,7 @@ public static void logDelete(Class type, String oid, O if (!LOGGER_OP.isDebugEnabled()) { return; } - LOGGER_OP.debug("{} delete {}: {}", PREFIX, type.getSimpleName(), oid, getStatus(subResult)); + LOGGER_OP.debug("{}-{} delete {}: {}", PREFIX, type.getSimpleName(), oid, getStatus(subResult)); } public static void logGetObject(Class type, String oid, diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryFactory.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryFactory.java index 9fcd83ad949..d0a1499a9d8 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryFactory.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryFactory.java @@ -288,7 +288,7 @@ private void removeFile(File file) throws IOException { if (file.exists()) { LOGGER.info("Deleting file '{}', result: {}", new Object[]{file.getAbsolutePath(), file.delete()}); } else { - LOGGER.info("File '{}' doesn't exist.", new Object[]{file.getAbsolutePath(), file.delete()}); + LOGGER.info("File '{}' doesn't exist: delete status {}", new Object[]{file.getAbsolutePath(), file.delete()}); } } diff --git a/repo/security-enforcer-impl/src/main/java/com/evolveum/midpoint/security/enforcer/impl/SecurityEnforcerImpl.java b/repo/security-enforcer-impl/src/main/java/com/evolveum/midpoint/security/enforcer/impl/SecurityEnforcerImpl.java index fbe08589dee..1763bc5fc3b 100644 --- a/repo/security-enforcer-impl/src/main/java/com/evolveum/midpoint/security/enforcer/impl/SecurityEnforcerImpl.java +++ b/repo/security-enforcer-impl/src/main/java/com/evolveum/midpoint/security/enforcer/impl/SecurityEnforcerImpl.java @@ -1280,7 +1280,7 @@ private ObjectFilter preProcessObje ObjectFilter objSpecRoleRelationFilter = processRoleRelationFilter(principal, autz, specRoleRelation, queryItemsSpec, origFilter); if (objSpecRoleRelationFilter == null) { if (autz.maySkipOnSearch()) { - LOGGER.trace(" not applying roleRelation filter because it is not efficient and maySkipOnSearch is set", objSpecRoleRelationFilter); + LOGGER.trace(" not applying roleRelation filter {} because it is not efficient and maySkipOnSearch is set", objSpecRoleRelationFilter); applicable = false; } else { objSpecRoleRelationFilter = NoneFilter.createNone();