From b3235c395d952f5fae84f978f2ae348ecbeea214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mat=C4=9Bj=C4=8Dek?= Date: Thu, 30 Jan 2025 20:38:00 +0100 Subject: [PATCH] AdminMain - don't drop causes from logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Matějček --- .../java/com/sun/enterprise/admin/cli/AdminMain.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java index ee6eb6d88fa..2d5b83c222e 100644 --- a/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java +++ b/nucleus/admin/cli/src/main/java/com/sun/enterprise/admin/cli/AdminMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation + * Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the @@ -321,7 +321,7 @@ public int executeCommand(String[] argv) { cmd = CLICommand.getCommand(cliContainer, command); return cmd.execute(argv); } catch (CommandValidationException cve) { - logger.severe(cve.getMessage()); + logger.log(SEVERE, cve.getMessage(), cve); if (cmd == null) // error parsing program options { printUsage(); @@ -331,7 +331,7 @@ public int executeCommand(String[] argv) { return ERROR; } catch (InvalidCommandException ice) { // find closest match with local or remote commands - logger.severe(ice.getMessage()); + logger.log(SEVERE, ice.getMessage(), ice); try { po.setEcho(false); CLIUtil.displayClosestMatch(command, @@ -344,7 +344,7 @@ public int executeCommand(String[] argv) { } catch (CommandException ce) { if (ce.getCause() instanceof ConnectException) { // find closest match with local commands - logger.severe(ce.getMessage()); + logger.log(SEVERE, ce.getMessage(), ce); try { CLIUtil.displayClosestMatch(command, CLIUtil.getLocalCommands(cliContainer), @@ -353,7 +353,7 @@ public int executeCommand(String[] argv) { logger.info(strings.get("InvalidRemoteCommand", command)); } } else { - logger.severe(ce.getMessage()); + logger.log(SEVERE, ce.getMessage(), ce); } return ERROR; }