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 mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 58FC410325 for ; Wed, 19 Mar 2014 14:17:28 +0000 (UTC) Received: (qmail 89787 invoked by uid 500); 19 Mar 2014 14:17:27 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 89168 invoked by uid 500); 19 Mar 2014 14:17:25 -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 89147 invoked by uid 99); 19 Mar 2014 14:17:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2014 14:17:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ralph.goers@dslextreme.com designates 209.85.213.42 as permitted sender) Received: from [209.85.213.42] (HELO mail-yh0-f42.google.com) (209.85.213.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Mar 2014 14:17:18 +0000 Received: by mail-yh0-f42.google.com with SMTP id t59so8565189yho.15 for ; Wed, 19 Mar 2014 07:16:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:references:from:content-type :in-reply-to:message-id:date:to:content-transfer-encoding :mime-version; bh=+rKFsRsV808fnPusdr7xNff6KuM4YDgt3n9ZvmdwNKM=; b=HWETqOAqm1yjFePe7kLh21O7yaq+OA4QSWyKSF59F7KbDcGdxukd4L42XLL/pyad0d 9dIb9CDeXj7g4VXBWKBQUuujoutr69B1L4pWnlgleAgqaGTy3X35+25wx0tppoONqLwY RbI+XcOXtopsn/5+gBb01TtrgLtVDnQv5vDQ0syvYyA5057RzevmIP3FuRse/d/UbJYQ MoUO9zXR6c4uegSL45f+lemPWQbAnMUFXvB04Oj8uTGIcCeRAV+HlNwVUZdDinBlf7N3 B1WNa98L3Nlp+bpGE5bWnp3ZEZnh1b0ULpK93sGjvJCQQvoy/YoUDoZDptbT1LlAIxas 9UzQ== X-Gm-Message-State: ALoCoQlhQ6V1bwMiNMi56FM6MIhYW38/kprHH+9vakKqvt+PqTLTlpUTt4IpCm5So7DMF4VD3Wv0 X-Received: by 10.236.71.100 with SMTP id q64mr2859438yhd.133.1395238617895; Wed, 19 Mar 2014 07:16:57 -0700 (PDT) Received: from [192.168.10.70] (99-180-69-21.lightspeed.irvnca.sbcglobal.net. [99.180.69.21]) by mx.google.com with ESMTPSA id h23sm43789225yhc.0.2014.03.19.07.16.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 07:16:56 -0700 (PDT) Sender: "ralph.goers @dslextreme.com" Subject: Re: Logging to different files with log4j 2 References: From: Ralph Goers Content-Type: text/plain; charset=us-ascii X-Mailer: iPad Mail (11D167) In-Reply-To: Message-Id: <3D78D4E0-7AF8-4116-BB56-AB3EE6ADCB97@apache.org> Date: Wed, 19 Mar 2014 07:16:56 -0700 To: Log4J Users List Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) X-Virus-Checked: Checked by ClamAV on apache.org Yes, this is possible with the RoutingAppender. Ralph > On Mar 18, 2014, at 11:47 PM, Heribert Hansen wrote: >=20 > I have an application that should write logging information into different= > files. The application executes several tasks (partially in parallel). > Every task should use a separate file for logging. The filename should be > "{loggingBasePath}/{taskId}.log". The loggingBasePath will be configurable= > by a command line argument. The taskId is the id of the task the > application executes and will be assigned at runtime to the task after > instantiation of the task. As you can see, the filename of the log is very= > dynamic and is not defined at startup. >=20 > The other parts of the application should write log entries to another log= > file called application.log. >=20 > Is that possible with log4j 2? >=20 > Thank you very much! --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org