The catalina logger has exclusive access for writing but you can try RandomAccessFile with read only mode for a quick peek at the loghttp://docs.oracle.com/javase/6/docs/api/java/io/RandomAccessFile.html#RandomAccessFile(java.io.File, java.lang.String) Saludos Cordiales Martin ______________________________________________ Porfavor..no altere esta communicacion..Gracias
> To: users@tomcat.apache.org > Subject: RE: How can I access tomcat's logs using my jsp? > From: lev.kara...@raiffeisen.ru > Date: Mon, 6 Feb 2012 15:53:11 +0400 > > Charles, > > thank for your explanation. > > Now everything (exept one thing) seems to work fine. > > The only problem left is - when I'm copypasting the default servlet block > to $CATALINA_BASE/logs/WEB-INF/web.xml , the application no longer works. > Without it everything works fine (but I can't disable the directory > listings general setting because I need it swithed on for the /logs dir). > > The block that I copy is : > > <servlet> > <servlet-name>default</servlet-name> > > <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> > <init-param> > <param-name>debug</param-name> > <param-value>0</param-value> > </init-param> > <init-param> > <param-name>listings</param-name> > <param-value>true</param-value> > </init-param> > <load-on-startup>1</load-on-startup> > </servlet> > > (I place it inside the <web-app> section) > > > And one more question - if myapp's docBase is set to $CATALINA_BASE/logs , > does it matter what is in the webapps/myapp folder? > > > Thanks in advance. > > > "Caldarale, Charles R" <chuck.caldar...@unisys.com> wrote on 04.02.2012 > 01:44:08: > > > "Caldarale, Charles R" <chuck.caldar...@unisys.com> > > 04.02.2012 01:45 > > > > Please respond to > > "Tomcat Users List" <users@tomcat.apache.org> > > > > To > > > > Tomcat Users List <users@tomcat.apache.org> > > > > cc > > > > Subject > > > > RE: How can I access tomcat's logs using my jsp? > > > > > From: André Warnier [mailto:a...@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. > > > > > - 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 <Host> appBase directory. The <Context> 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 <servlet> 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. > > > > - Chuck > > > > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE > > PROPRIETARY MATERIAL and is thus for use only by the intended > > recipient. If you received this in error, please contact the sender > > and delete the e-mail and its attachments from all computers. > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > ----------------------------------- > This message and any attachment are confidential and may be privileged or > otherwise protected from disclosure. If you are not the intended recipient > any use, distribution, copying or disclosure is strictly prohibited. If you > have received this message in error, please notify the sender immediately > either by telephone or by e-mail and delete this message and any attachment > from your system. Correspondence via e-mail is for information purposes only. > ZAO Raiffeisenbank neither makes nor accepts legally binding statements by > e-mail unless otherwise agreed. > -----------------------------------