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 1AD9B9BBB for ; Fri, 3 Feb 2012 22:47:43 +0000 (UTC) Received: (qmail 13254 invoked by uid 500); 3 Feb 2012 22:47:39 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 12936 invoked by uid 500); 3 Feb 2012 22:47:38 -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 12927 invoked by uid 99); 3 Feb 2012 22:47:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 22:47:38 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2012 22:47:29 +0000 Received: from [192.168.245.129] (p549E0A42.dip0.t-ipconnect.de [84.158.10.66]) by tor.combios.es (Postfix) with ESMTPA id 4005BDA05CF for ; Fri, 3 Feb 2012 23:47:08 +0100 (CET) Message-ID: <4F2C63EA.4050108@ice-sa.com> Date: Fri, 03 Feb 2012 23:47:06 +0100 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: How can I access tomcat's logs using my jsp? References: <4F2C40F7.7000400@tmbsw.com> <4F2C4FD4.60602@ice-sa.com> <99C8B2929B39C24493377AC7A121E21FB0111228AC@USEA-EXCH8.na.uis.unisys.com> In-Reply-To: <99C8B2929B39C24493377AC7A121E21FB0111228AC@USEA-EXCH8.na.uis.unisys.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Caldarale, Charles R wrote: >> From: Andr� Warnier [mailto:aw@ice-sa.com] >> Subject: Re: How can I access tomcat's logs using my jsp? > >> - you can create a webapp named "tomcat-logs" (or whatever), just by >> creating a new directory "tomcat-logs" (or whatever) under webapps. > > Nope. Here I beg to differ. The statement above was entirely accurate. This application won't do anything, and even less what the OP wanted, but it will exist, and Tomcat will dispatch to it. > >> - to protect access to it, you'll need a WEB-INF/web.xml, with some >> security/auth constraints, just like any other protected application. > > That is needed. However, this WEB-INF directory and consequently the WEB-INF/web.xml file must be placed in Tomcat's log directory. > >> - you will need a META-INF/context.xml, specifying as docBase, the >> directory where the logs really are. > > Nope, that won't work; docBase is not allowed when the webapp is inside the appBase directory. The element must be placed in conf/Catalina/[hostName]/[appName].xml, with the docBase pointing to the location of the logs directory. > >> - and you will need to specify somewhere, that for this directory, >> Tomcat is allowed to generate a page with an index to the files. > > That's done by enabling the listings parameter for the DefaultServlet. The OP will need to copy the tag and its sub-tags for the DefaultServlet from conf/web.xml to the log webapp's WEB-INF/web.xml and set the listings parameter to true. You do not want to enable the listings parameter in the global conf/web.xml for what should be obvious reasons. > Thanks for rectifying my sloppy suggestions and providing the accurate instructions. In my defense, I will argue that my suggestions were made with good intentions, that at least the general idea was fine, and I will thus beg for the forgiveness of the court. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org