Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9BD6B200D24 for ; Tue, 24 Oct 2017 18:40:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9A499160BDB; Tue, 24 Oct 2017 16:40:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B63D11609C8 for ; Tue, 24 Oct 2017 18:40:44 +0200 (CEST) Received: (qmail 97752 invoked by uid 500); 24 Oct 2017 16:40:43 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 97730 invoked by uid 99); 24 Oct 2017 16:40:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2017 16:40:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 280A71800FF for ; Tue, 24 Oct 2017 16:40:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.879 X-Spam-Level: ** X-Spam-Status: No, score=2.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id fnVWqZMV4OU3 for ; Tue, 24 Oct 2017 16:40:39 +0000 (UTC) Received: from mail-pg0-f54.google.com (mail-pg0-f54.google.com [74.125.83.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 044965F3E1 for ; Tue, 24 Oct 2017 16:40:39 +0000 (UTC) Received: by mail-pg0-f54.google.com with SMTP id y5so7141570pgq.7 for ; Tue, 24 Oct 2017 09:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=OdbvMEZJ6wLwBNQ1PEcGfeXq1PxgyWXsr9N7alw2th4=; b=JCjOoUJ6lIRQGYrstyZ7X0VBp+9fNH8didz6hEnCcCqfCuqPB0l/LNnFfBoYHP8UUk 4E5Fc8L1tDin1wcw2DFZST5aWvz2xlqt2U0Ihlc32DKrXdZJlymMjK46X5fIOdl2TEC6 pIgvtDajYir8EAGxEJL3nZrCPZm3lqE44OoigHwOwOsfaU4TxHoj9By6/Ncq3Ar2z64m pYEYYVMPtd9CnK9snIPyBl3EpyAVxvSDSOmY5Fb+jsDO5wPDjnPy4BxmExntrdXf53B7 VDj3L2FOUvMIFYLNZYEFcxqtf5gxDJELhOWOB9/qj84QU50rTVbiCruVaqWqoIAaE6QB 0fhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=OdbvMEZJ6wLwBNQ1PEcGfeXq1PxgyWXsr9N7alw2th4=; b=TIp5apnC+vlM/Om47gPjqjrbUVEwCZ559+M4n4pSNtKbcHVJSt3y9FFnCqATZYbljT /cPWyZh/aIBeij/LPWVsFNoykD730URV1Uec9QvjmQYlNBJwqQQdsNzmXCCboemptgQz GTrSCB9O/PLWDGB62rpW3/QE8t/uN9TUbEuiENZ+6vleZBGrJtxz61BZxQiAaT9VjjbL OUoiJhc6cP4Qgho3zvwUI3pnVxo7rNPxkQQUCTBdtA7YV4B3JWLoAv60cWU2CBg0cx/4 SvB+7nW4Xg+PQWHNribkju4ORnknhrgR5HuNWFanj1aluF6pAC2xdUFn+bcYKplPVVYW ZBvg== X-Gm-Message-State: AMCzsaUkiEdePRESBQ0P3Zdi6G3z8mCq0nV3SU+jdd5bK4YEJpiv6DFx Uo58hU0VvpCepi5MAzF8iUgjEE2DeohegDx7P+Gpeg== X-Google-Smtp-Source: ABhQp+TV5+1mJXNQHF2L7lhGotvpJVZFJkvNYs2A9yG+VyCNJES1K+akduTE55cr3SKfgt28tTomPqtreub8rnSMWvI= X-Received: by 10.98.133.28 with SMTP id u28mr17458302pfd.241.1508863237279; Tue, 24 Oct 2017 09:40:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.141.228 with HTTP; Tue, 24 Oct 2017 09:40:36 -0700 (PDT) In-Reply-To: References: From: Louis Smith Date: Tue, 24 Oct 2017 12:40:36 -0400 Message-ID: Subject: Re: Log4j2 configuration with struts 2.5.x To: Struts Developers List Content-Type: multipart/alternative; boundary="94eb2c0a535645d40d055c4d99f6" archived-at: Tue, 24 Oct 2017 16:40:45 -0000 --94eb2c0a535645d40d055c4d99f6 Content-Type: text/plain; charset="UTF-8" 1) Maven Dependencies: We do a lot of logging, and have a lot of libraries that bring their own requirements, so this is what we have: In the stanza: UTF-8 1.8 2.5.13 3.0.7 4.1.0.RELEASE 4.1.0.RELEASE 5.1.0.Final 2.6.2 3.2.0.Final 2.22.4 1.7.12 in the dependencies: org.apache.logging.log4j log4j-core ${log4j2.version} org.apache.logging.log4j log4j-api ${log4j2.version} org.apache.logging.log4j log4j-1.2-api ${log4j2.version} org.apache.logging.log4j log4j-slf4j-impl ${log4j2.version} org.jboss.logging jboss-logging ${jboss.logging.version} 2) log4j2.xml (not a properties file at this time...) Put your contextRoot as the log-name BusinessPortal ${sys:LOG_HOME} ${sys:LOG_LEVEL} ${sys:LOG_MAXFILESIZE} ${sys:LOG_MAXBACKUPINDEX} %d{MM/dd/yyyy HH:mm:ss,SSS}- %c{10}: %m%n 3) In our server, we set environment variables used by the log4j2.xml, so the environments (dev/beta/prod) can have different setup: For weblogic, a setUserOverrides.cmd: set JAVA_OPTIONS=%JAVA_OPTIONS% -DLOG_HOME=/u01/projects/app-logs -DLOG_LEVEL=DEBUG -DLOG_MAXFILESIZE=500KB -DLOG_MAXBACKUPINDEX=5 -DCOMMON_HOME=/u01/projects/common for WildFly, add properties in standalone.xml - this from my laptop development environment: Hope that helps! Louis On Tue, Oct 24, 2017 at 6:47 AM, ravirajmishra98@gmail.com < ravirajmishra98@gmail.com> wrote: > Hello, > > I have migrated my project from struts 2.3 to struts 2.5 . > I am facing a problem while upgrading to log4j2 from log4j1 > I need help to configure the log4j2 with my system > > My questions are. > > 1. What jars I need to add to my system for log4j2 > 2. How to write the log4j.properties files for log4j2 > > Thanks > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org > For additional commands, e-mail: dev-help@struts.apache.org > > --94eb2c0a535645d40d055c4d99f6--