Re: How to access the request URL in a custom valve implementation?

2024-01-26 Thread Tim Funk
See AbstractAccessLogValve (which AccessLogValve overrides) Then you could override AbstractAccessLogValve.createAccessLogElement() which has case 'q': return new QueryElement(); To possible do doing something like case 'q': return new ObfuscatedQueryElemen

Re: How to access the request URL in a custom valve implementation?

2024-01-26 Thread Manak Bisht
I want to obfuscate values of query params for certain URLs, however, I would still like to log the request. Therefore, I cannot use the existing conditionif/conditionunless attributes that AccessLogValve provides. Sincerely, Manak Bisht On Fri, Jan 26, 2024 at 6:18 PM Mark Thomas wrote: > On 2

Re: How to access the request URL in a custom valve implementation?

2024-01-26 Thread Mark Thomas
On 26/01/2024 10:46, Manak Bisht wrote: Hi, I am trying to extend the AccessLogValve to modify logging behaviour for certain URLs. However, I don't have access to the request object in the AccessLogValve API. So, I am left with regex matching on the CharArrayWriter message object. Is there a bett

Re: How to access the request URL in a custom valve implementation?

2024-01-26 Thread Tim Funk
My bad - AccessLogValve also supports that feature too - *%{xxx}r* write value of ServletRequest attribute with name xxx (escaped if required, value ?? if request is null) https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Logging -Tim On Fri, Jan 26, 2024 at 7:23 AM Tim F

Re: How to access the request URL in a custom valve implementation?

2024-01-26 Thread Tim Funk
It depends on what you are trying to accomplish. ExtendedAccessLogValve is a little more flexible where you can write out arbitrary request attributes but still format the request like the standard access log. So you could have a filter set the value and not need to write your own access logger. -

How to access the request URL in a custom valve implementation?

2024-01-26 Thread Manak Bisht
Hi, I am trying to extend the AccessLogValve to modify logging behaviour for certain URLs. However, I don't have access to the request object in the AccessLogValve API. So, I am left with regex matching on the CharArrayWriter message object. Is there a better way to do this? Sincerely, Manak Bisht

how to configure a custom valve?

2011-04-04 Thread colin lloyd
I am using Tomcat 7.0 and need to pass some additional data to my JAAS login module during authentication with standard FORM logins. By default using the FORM login in the web application causes Tomcat to invoke the FormAuthenticator valve which only passes username and password to the login modu

Re: Custom Valve

2009-07-07 Thread Sumit D
Hey Chris, Thanks a lot for the detailed reply. At the moment, I have written a class that extends AccessLogValve.java. I deactivated the AccessLogValve from the server.xml and element to your for this new Extended Valve.(We wanted it at Engine level.) Works completely fine! Thanks for the clar

Re: Custom Valve

2009-07-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sumit, On 7/1/2009 4:02 AM, Sumit D wrote: > - Extend the ValveBase class, Implement LifeCycle (not obligatory) > - write invoke method implementation > - compile and create its .jar file and put it in Catalina_Home/lib > - point it using the context.

Re: Custom Valve

2009-07-01 Thread Sumit D
Thank you Chris and Chuck for your replies. I tried to write a Custom Valve but please correct me if I am wrong: when writing a custom valve, - Extend the ValveBase class, Implement LifeCycle (not obligatory) - write invoke method implementation - compile and create its .jar file and put it in

Re: Custom Valve

2009-06-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sumit, On 6/25/2009 7:42 AM, Sumit D wrote: > *By "write some data in an object" I wanted to say that, when the logs are > written, * > *then and there I would like to have the same information encapsulated in an > object* > because we need to send it

RE: Custom Valve

2009-06-25 Thread Caldarale, Charles R
> From: Sumit D [mailto:sumitd...@gmail.com] > Subject: Re: Custom Valve > > by the way, I could not find META-INF/context.xml. I create from > scratch ? Yes, create it if you need one. Many webapps do not require the Tomcat-specific settings available via a element. >

Re: Custom Valve

2009-06-25 Thread Sumit D
how can I achieve this ?? I might be able to add some > > code where it writes to logs, so that it will also write to some > > object. > > What do you mean when you say "write some data in an object"? > > > But then I have no idea how to Deploy this custom va

Re: Custom Valve

2009-06-24 Thread Christopher Schultz
t as well. > Any pointers on how can I achieve this ?? I might be able to add some > code where it writes to logs, so that it will also write to some > object. What do you mean when you say "write some data in an object"? > But then I have no idea how to Deploy this custom

Custom Valve

2009-06-24 Thread Sumit D
, so that it will also write to some object. But then I have no idea how to Deploy this custom valve. Also, Valve Component specifies that the log "pattern" supports many things like %h, %l, etc but so far, i could not find how can I include all those(pattern codes) in the log file. Any

Re: Custom valve, how to change role?

2009-06-19 Thread Bruce Edge
On Thu, Jun 18, 2009 at 3:28 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: > > From: Bruce Edge [mailto:bruce.e...@gmail.com] > > Subject: Custom valve, how to change role? > > > > ...or am I completely off in left field and should scrap > > th

RE: Custom valve, how to change role?

2009-06-18 Thread Caldarale, Charles R
> From: Bruce Edge [mailto:bruce.e...@gmail.com] > Subject: Custom valve, how to change role? > > ...or am I completely off in left field and should scrap > this before someone gets hurt and just use securityfilter? If you really insist on differentiating internal and external

Custom valve, how to change role?

2009-06-18 Thread Bruce Edge
In an attempt, possibly misguided, to try avoid using securityfilter, I'm trying to write a valve to bypass the ssl authentication requirements of a service based on remote host addr. I've implemented a LocalValve that extends ValveBase and implements Valve. Given that I must implement this:

Custom Valve

2008-04-18 Thread Zach Cox
I'm using Tomcat 6.0.14 and need to write a custom Valve to control the Domain property of the JSESSIONID cookie (so it will be reused on any subdomain) but I can't find any documentation on how to go about creating a custom Valve. Could someone please let me know if this is accurate?

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: Re: classpath problems with a custom valve > > What is confusing to me is why when i put my jar into > server/lib, the web app doesn't also have access to > classes loaded from there. Look at the 5.

Re: classpath problems with a custom valve

2007-09-10 Thread Steve Souza
ote: > > > From: Steve Souza [mailto:[EMAIL PROTECTED] > > Subject: Re: classpath problems with a custom valve > > > > It is still a bit mysterious and not ideal as installation > > requires a class put in server/classes as well as the jar in > > common/l

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: Re: classpath problems with a custom valve > > It is still a bit mysterious and not ideal as installation > requires a class put in server/classes as well as the jar in > common/lib, but it will do. Using a valve is by n

Re: classpath problems with a custom valve

2007-09-10 Thread Steve Souza
TED] > > Subject: Re: classpath problems with a custom valve > > > > I get the following exception which seems odd as I saw the missing > class in > > catalina.jar and I compiled against it. > > Java classloading hierarchy is not bidirectional - classes can see only

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: Re: classpath problems with a custom valve > > I get the following exception which seems odd as I saw the missing class in > catalina.jar and I compiled against it. Java classloading hierarchy is not bidirectional - class

Re: classpath problems with a custom valve

2007-09-10 Thread Steve Souza
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) On 9/10/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > > > From: Steve Souza [mailto:[EMAIL PROTECTED] > > Subject: Re: classpath problems with a custom valve > > > > common/lib is for jars are only needed by web apps whereas &

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: Re: classpath problems with a custom valve > > common/lib is for jars are only needed by web apps whereas > shared/lib is for web apps AND tomcat. Read the doc again - you have it backwards. - Chuck THIS COMMUNICAT

Re: classpath problems with a custom valve

2007-09-10 Thread Steve Souza
hen this classloader repositories are relative to $CATALINA_BASE rather than $CATALINA_HOME. On 9/10/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > > > From: Steve Souza [mailto:[EMAIL PROTECTED] > > Subject: Re: classpath problems with a custom valve > > > > based o

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: Re: classpath problems with a custom valve > > based on this document I placed my jar in server/lib as both > web apps and tomcat need access to the classes in this jar. What part of the Tomcat doc led you to that conclusi

Re: classpath problems with a custom valve

2007-09-10 Thread Steve Souza
org.apache.catalina.startup.Catalina start On 9/10/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > > > From: Steve Souza [mailto:[EMAIL PROTECTED] > > Subject: classpath problems with a custom valve > > > > Shouldn't my war be able to see the classes from a jar > >

RE: classpath problems with a custom valve

2007-09-10 Thread Caldarale, Charles R
> From: Steve Souza [mailto:[EMAIL PROTECTED] > Subject: classpath problems with a custom valve > > Shouldn't my war be able to see the classes from a jar > put into server/lib? No - read the doc: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html You proba

classpath problems with a custom valve

2007-09-10 Thread Steve Souza
I posted a question earlier, but now have some more info I have a custom valve that monitors page accesses in tomcat. It works in tomcat 6, and under tomcat 5.5 that comes bundled with jboss. I can not get it to work in tomcat 5.5.25. I put the jar in server/lib and the war I install that

Re: Write custom valve?

2007-07-25 Thread Johnny Kewl
- Original Message - From: "Doug Black" <[EMAIL PROTECTED]> To: Sent: Wednesday, July 25, 2007 9:58 PM Subject: Re: Write custom valve? Filip Hanik - Dev Lists hanik.com> writes: take the source code of the RemoteAddrValve and start there. Basical

Re: Write custom valve?

2007-07-25 Thread Doug Black
er to not trigger the valve on the "protected" urls Johnny Kewl kewlstuff.co.za> writes: > > Doug, I have never tried this, so as usual, I guessing here. > > I dont think you are going to come right with the standard valves, nor do I > think you should try make a cust

Re: Write custom valve?

2007-07-25 Thread Johnny Kewl
Doug, I have never tried this, so as usual, I guessing here. I dont think you are going to come right with the standard valves, nor do I think you should try make a custom valve. Rather look at filters, they not much more difficult to make than a normal servlet, and you will find tons of stuff

Re: Write custom valve?

2007-07-24 Thread Filip Hanik - Dev Lists
and also through the user realm for the context. Do I have to write a custom valve java class? How hard is this for an intermediate Java writer? Any tips on how to do this? take the source code of the RemoteAddrValve and start there. Basically, in the valve is request.getPrincipal returns null

Write custom valve?

2007-07-24 Thread Doug Black
user realm for the context. Do I have to write a custom valve java class? How hard is this for an intermediate Java writer? Any tips on how to do this? I apologize that I submitted essentially the same question a couple days ago, but I got no responses so I thought I'd try with a less ve