Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 39AAF10FE8 for ; Tue, 8 Sep 2015 10:32:14 +0000 (UTC) Received: (qmail 87615 invoked by uid 500); 8 Sep 2015 10:31:12 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 87554 invoked by uid 500); 8 Sep 2015 10:31:12 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 87543 invoked by uid 99); 8 Sep 2015 10:31:12 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Sep 2015 10:31:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 515DBC01AB for ; Tue, 8 Sep 2015 10:31:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.979 X-Spam-Level: ** X-Spam-Status: No, score=2.979 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XD34EEQKSQ-f for ; Tue, 8 Sep 2015 10:31:11 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id D0AD923040 for ; Tue, 8 Sep 2015 10:31:10 +0000 (UTC) Received: by lbbmp1 with SMTP id mp1so50804971lbb.1 for ; Tue, 08 Sep 2015 03:31:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=avVjfgURmTiVhRNK966Z1v6duzhRd8/71vWBiBDHIV4=; b=QLJybOSYAK2BJ94Iol5NM5tepNUwJI6Hmvd6NJmQL4iWq3QmZZybNWsIDfkdio3uKI 1Vhg1hhK7kGVdI5G05M0CvUOHYKaKoXEGa1JXKUduk20RwZh2qyhtcDOiB0RAvcOPP/I MIqxuzyGvyaB1dx0F06fJTh5HYBuAZHF7k/QY1cqEJp2mpD+vZZApYVoNJquXuW0Eur/ IonMSA5dgmhp+n2rNCEgHKWRua+M1MZiepNUT1sz6wG16DSwUV5JCDZTQNmu85BKc8ne dIC5NKSHCrEzh3ALp2IExmMIJImoN2e+nlYNYW5UbYdHrFMCUDTywNCD2jk7FHOGDf6k QuAw== X-Gm-Message-State: ALoCoQkRpuvmC4SemFsBanWnKMrSMEkx4KG0cfkj13RzAooJ0HJv9wgwHj/236lManWj4xDsNr5k MIME-Version: 1.0 X-Received: by 10.152.9.70 with SMTP id x6mr21899261laa.34.1441708263196; Tue, 08 Sep 2015 03:31:03 -0700 (PDT) Received: by 10.25.42.70 with HTTP; Tue, 8 Sep 2015 03:31:02 -0700 (PDT) Date: Tue, 8 Sep 2015 18:31:02 +0800 Message-ID: Subject: Tomcat access log customization From: Eric Tang To: users@tomcat.apache.org Content-Type: multipart/alternative; boundary=089e0158aef6e5e65a051f39dc76 --089e0158aef6e5e65a051f39dc76 Content-Type: text/plain; charset=UTF-8 Dear Tomcat support, I am a developer working on Java applications and have been using different containers and deployment platforms. I would like to have a question on the access logs. The access logs of Tomcat is configured in $TOMCAT_HOME/conf/server.xml, the "Valve" attribute with className="org.apache.catalina.valves.AccessLogValve". The format of log is governed by the pattern expression, referenced in the documentation of Tomcat (TOMCAT_URI/config/valve.html). Is it possible to format the log with customized field name and string contents? I've been looking for answer in the web but no clear answer is found. I read through the usage / developer docs and source codes of Tomcat and find some clues. Would such require modifications of Tomcat source codes: Editing "protected AccessLogElement createAccessLogElement()" to add new pattern items in the switch-case flow for any new field-value pairs, and implement new element class(es) for AccessLogValue. Could you please kindly help to advise? Thank you. Eric --089e0158aef6e5e65a051f39dc76--