From log4j-user-return-29702-apmail-logging-log4j-user-archive=logging.apache.org@logging.apache.org Wed Oct 7 23:46:39 2020 Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with ESMTP id E21CB1A8F0 for ; Wed, 7 Oct 2020 23:46:38 +0000 (UTC) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id 8FA63123687 for ; Wed, 7 Oct 2020 23:46:38 +0000 (UTC) Received: (qmail 98067 invoked by uid 500); 7 Oct 2020 23:46:37 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 98027 invoked by uid 500); 7 Oct 2020 23:46:37 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 98016 invoked by uid 99); 7 Oct 2020 23:46:37 -0000 Received: from spamproc1-he-fi.apache.org (HELO spamproc1-he-fi.apache.org) (95.217.134.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Oct 2020 23:46:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-fi.apache.org (ASF Mail Server at spamproc1-he-fi.apache.org) with ESMTP id 4F9B5C0158 for ; Wed, 7 Oct 2020 23:46:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-fi.apache.org X-Spam-Flag: NO X-Spam-Score: 0.199 X-Spam-Level: X-Spam-Status: No, score=0.199 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.2, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamproc1-he-fi.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=hotpads-com.20150623.gappssmtp.com Received: from mx1-he-de.apache.org ([116.203.227.195]) by localhost (spamproc1-he-fi.apache.org [95.217.134.168]) (amavisd-new, port 10024) with ESMTP id bZ1rhAt4GNtg for ; Wed, 7 Oct 2020 23:46:35 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::82b; helo=mail-qt1-x82b.google.com; envelope-from=cguillaume@hotpads.com; receiver= Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 7447C7FB70 for ; Wed, 7 Oct 2020 23:46:35 +0000 (UTC) Received: by mail-qt1-x82b.google.com with SMTP id c5so3617344qtw.3 for ; Wed, 07 Oct 2020 16:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotpads-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=DboqgeIf1wzbu1NxEDzZps3YZnppcBw9kYDlgy/4b/k=; b=2NhDwpsWZFHcxLbF+sM7WxBDYgSBu4sp3a9dcnktKoh5irZH+LDisosDkFf6id/nb+ qwtnBewF1Uh4f3l5GDZpGYHzQZSnz4E4sfPQ0zz3CAx+QAfeNXSu5edVRYoX4Gfxh7/A 6OrN/4jMrPHyDQZR0OJjE5xn19Y9CAfhIh7AZpxYvsQFsWjAH8yOEenVChYFpPP7KYyE s8HZrPv7lgE/FMM/Lhh746ADgSSlDBUAAyfIJ0fSOfYo3iU6fHnVRszsgerp1ZcUcPRI 0b8OrVMSvSn0ascwwbC64FBFKR7BH2tcpVRnLZ9KXZM2pwImz0GQkVOQQclK1Lm/opUQ CjmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DboqgeIf1wzbu1NxEDzZps3YZnppcBw9kYDlgy/4b/k=; b=M4IVtSb2CIQMk5vcTePz4T7kTJc97hM+FMevNUEn20AAw07El0bk+8MygU8jATxgyD umw8LV6Ux5WYYrMuNO57gl5IBe9UixMYK2U3nfPA2VUSaT7eGYcAmbIuZ9obVhVyCLAP VI3EAUSeymBEdt3+0kgLE+f5Dr/GXK61e6R8lvkrb51U6L4VbWc2g9bOZpD3d/nUP1Ck vs2cg307BNcjoWbAFgbeQ4lvmvn7Jz3YKE6Ug1xy2m6vQm/6Y5XAFMQH+/fFmbyqPrpY E4w43SwwaSgS4x3YzpmggTDYKJYAQ6+vBz8WqY7MdthBrFz7NbarfivGczB7as5hF9DI 6X4w== X-Gm-Message-State: AOAM530sj3wgOy5Vqjc/xXIqnkAoUEBTa988ieGT9VVWRzDcXWMKCwwn kfBcgirMT3kIN+FnobI1nqD7o3HWJohCyR7EyPejf9smiTuRviQ4zfU= X-Google-Smtp-Source: ABdhPJxy7L49RLSDRKEeaPid5gKbtx/vlbDRjjbhbKnxTmAdNttu7n3GGo7YBQMs8DUpsAJCleNOZpAKe+EM5LMmNpw= X-Received: by 2002:ac8:6901:: with SMTP id e1mr5953301qtr.122.1602114387057; Wed, 07 Oct 2020 16:46:27 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Cl=C3=A9ment_Guillaume?= Date: Wed, 7 Oct 2020 16:46:15 -0700 Message-ID: Subject: logging Exception toString with slf4j To: Log4J Content-Type: multipart/alternative; boundary="000000000000ee346505b11d5295" --000000000000ee346505b11d5295 Content-Type: text/plain; charset="UTF-8" Hi, I'm using slf4j (1.7.25) and log4j (2.13.3). My config is simple, just a console appender. I'm trying to log the toString of an Exception with a parameterized message. It works fine when there is more than one parameter, but when it's a single one, the whole exception stacktrace is printed. org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger("loggerName"); > logger.warn("{} {} ", "an error occured", new Exception("my message")); // > work as expected: print only the toString > logger.warn("{} ", new Exception("my message")); // print the curly > brackets and the whole stacktrace an error occured java.lang.Exception: my message > {} > java.lang.Exception: my message > at com.example.Main.main(Main.java:206) [test-classes/:?] > I wanted to confirm this is a bug and wanted to know if it's more likely caused by slf4j or log4j? Thank you. --000000000000ee346505b11d5295--