You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Niklas Gustavsson <ni...@protocol7.com> on 2008/04/04 12:20:11 UTC

Make LoggingFilter.log() protected

Hi

I would like to create a custom logging filter for use in FtpServer,
the reason is to mask out the password sent in the PASS command from
logs. Here's the RFE:
https://issues.apache.org/jira/browse/FTPSERVER-120

To make this reasonably straight-forward without forking the current
LoggingFIlter, I'm wondering if you would be okay with changing the
LoggingFilter.log method from private to protected?

/niklas

Re: Make LoggingFilter.log() protected

Posted by Niklas Gustavsson <ni...@protocol7.com>.
2008/4/4 Niklas Gustavsson <ni...@protocol7.com>:
> I ran:
>  svn up
>  mvn clean compile
>
>  Let me do a clean checkout later tonight and look a bit further into
>  my build issues.

The problem was due to a broken statemachine JAR in my local Maven
repo. Cleaning out all MINA artifacts from the local repo now produces
a wonderfully working build :-)

/niklas

Re: Make LoggingFilter.log() protected

Posted by Niklas Gustavsson <ni...@protocol7.com>.
I ran:
svn up
mvn clean compile

Let me do a clean checkout later tonight and look a bit further into
my build issues.

/niklas

On Fri, Apr 4, 2008 at 3:32 PM, Julien Vermillard
<jv...@archean.fr> wrote:
> Works here too,
>  Niklas you made a "clean install" or just an "install" ?
>
>  Julien
>  On Fri, 4 Apr 2008 22:11:51 +0900 (KST)
>
> "이희승 (Trustin Lee) <tr...@gmail.com> wrote:
>
>
>
> > That's weird.  It builds OK for me.  Let me deploy it anyway.
>  >
>  > Niklas Gustavsson wrote:
>  > > On Fri, Apr 4, 2008 at 1:51 PM, Julien Vermillard
>  > > <jv...@archean.fr> wrote:
>  > >>  You can easly deploy snapshot with this guide :
>  > >>  http://mina.apache.org/developer-guide.html#DeveloperGuide-DeployingSnapshots%28CommitersOnly%29
>  > >
>  > > Thanks! However, MINA trunk currently doesn't build. I haven't had
>  > > the time to investigate the details.
>  > >
>  > > [INFO]
>  > > ------------------------------------------------------------------------
>  > > [ERROR] BUILD FAILURE [INFO]
>  > > ------------------------------------------------------------------------
>  > > [INFO] Compilation failure
>  > >
>  > > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[31,35]
>  > > cannot find symbol
>  > > symbol  : class StateMachineProxyBuilder
>  > > location: package org.apache.mina.statemachine
>  > >
>  > > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[56,19]
>  > > cannot find symbol
>  > > symbol  : class StateMachineProxyBuilder
>  > > location: class org.apache.mina.example.tapedeck.Main
>  > >
>  > > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[70,16]
>  > > cannot find symbol
>  > > symbol  : constructor IoSessionStateContextLookup(<anonymous
>  > > org.apache.mina.statemachine.context.StateContextFactory>,java.lang.String)
>  > > location: class
>  > > org.apache.mina.statemachine.context.IoSessionStateContextLookup
>  > >
>  > > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[69,19]
>  > > cannot find symbol
>  > > symbol  : class StateMachineProxyBuilder
>  > > location: class org.apache.mina.example.tapedeck.Main
>  > >
>  > >
>  > > [INFO]
>  > > ------------------------------------------------------------------------
>  > > [INFO] For more information, run Maven with the -e switch [INFO]
>  > > ------------------------------------------------------------------------
>  > > [INFO] Total time: 27 seconds [INFO] Finished at: Fri Apr 04
>  > > 14:27:15 CEST 2008 [INFO] Final Memory: 23M/41M
>  > > [INFO]
>  > > ------------------------------------------------------------------------
>  > >
>  > >
>  > > /niklas
>  >
>

Re: Make LoggingFilter.log() protected

Posted by Julien Vermillard <jv...@archean.fr>.
Works here too,
Niklas you made a "clean install" or just an "install" ?

Julien
On Fri, 4 Apr 2008 22:11:51 +0900 (KST)
"이희승 (Trustin Lee) <tr...@gmail.com> wrote:

> That's weird.  It builds OK for me.  Let me deploy it anyway.
> 
> Niklas Gustavsson wrote:
> > On Fri, Apr 4, 2008 at 1:51 PM, Julien Vermillard
> > <jv...@archean.fr> wrote:
> >>  You can easly deploy snapshot with this guide :
> >>  http://mina.apache.org/developer-guide.html#DeveloperGuide-DeployingSnapshots%28CommitersOnly%29
> > 
> > Thanks! However, MINA trunk currently doesn't build. I haven't had
> > the time to investigate the details.
> > 
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD FAILURE [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Compilation failure
> > 
> > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[31,35]
> > cannot find symbol
> > symbol  : class StateMachineProxyBuilder
> > location: package org.apache.mina.statemachine
> > 
> > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[56,19]
> > cannot find symbol
> > symbol  : class StateMachineProxyBuilder
> > location: class org.apache.mina.example.tapedeck.Main
> > 
> > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[70,16]
> > cannot find symbol
> > symbol  : constructor IoSessionStateContextLookup(<anonymous
> > org.apache.mina.statemachine.context.StateContextFactory>,java.lang.String)
> > location: class
> > org.apache.mina.statemachine.context.IoSessionStateContextLookup
> > 
> > /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[69,19]
> > cannot find symbol
> > symbol  : class StateMachineProxyBuilder
> > location: class org.apache.mina.example.tapedeck.Main
> > 
> > 
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] For more information, run Maven with the -e switch [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 27 seconds [INFO] Finished at: Fri Apr 04
> > 14:27:15 CEST 2008 [INFO] Final Memory: 23M/41M
> > [INFO]
> > ------------------------------------------------------------------------
> > 
> > 
> > /niklas
> 

Re: Make LoggingFilter.log() protected

Posted by 이희승 (Trustin Lee) <t...@gmail.com>.
That's weird.  It builds OK for me.  Let me deploy it anyway.

Niklas Gustavsson wrote:
> On Fri, Apr 4, 2008 at 1:51 PM, Julien Vermillard
> <jv...@archean.fr> wrote:
>>  You can easly deploy snapshot with this guide :
>>  http://mina.apache.org/developer-guide.html#DeveloperGuide-DeployingSnapshots%28CommitersOnly%29
> 
> Thanks! However, MINA trunk currently doesn't build. I haven't had the
> time to investigate the details.
> 
> [INFO] ------------------------------------------------------------------------
> [ERROR] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Compilation failure
> 
> /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[31,35]
> cannot find symbol
> symbol  : class StateMachineProxyBuilder
> location: package org.apache.mina.statemachine
> 
> /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[56,19]
> cannot find symbol
> symbol  : class StateMachineProxyBuilder
> location: class org.apache.mina.example.tapedeck.Main
> 
> /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[70,16]
> cannot find symbol
> symbol  : constructor IoSessionStateContextLookup(<anonymous
> org.apache.mina.statemachine.context.StateContextFactory>,java.lang.String)
> location: class org.apache.mina.statemachine.context.IoSessionStateContextLookup
> 
> /media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[69,19]
> cannot find symbol
> symbol  : class StateMachineProxyBuilder
> location: class org.apache.mina.example.tapedeck.Main
> 
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 27 seconds
> [INFO] Finished at: Fri Apr 04 14:27:15 CEST 2008
> [INFO] Final Memory: 23M/41M
> [INFO] ------------------------------------------------------------------------
> 
> 
> /niklas

-- 
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/


Re: Make LoggingFilter.log() protected

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Apr 4, 2008 at 1:51 PM, Julien Vermillard
<jv...@archean.fr> wrote:
>  You can easly deploy snapshot with this guide :
>  http://mina.apache.org/developer-guide.html#DeveloperGuide-DeployingSnapshots%28CommitersOnly%29

Thanks! However, MINA trunk currently doesn't build. I haven't had the
time to investigate the details.

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure

/media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[31,35]
cannot find symbol
symbol  : class StateMachineProxyBuilder
location: package org.apache.mina.statemachine

/media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[56,19]
cannot find symbol
symbol  : class StateMachineProxyBuilder
location: class org.apache.mina.example.tapedeck.Main

/media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[70,16]
cannot find symbol
symbol  : constructor IoSessionStateContextLookup(<anonymous
org.apache.mina.statemachine.context.StateContextFactory>,java.lang.String)
location: class org.apache.mina.statemachine.context.IoSessionStateContextLookup

/media/big/home/svn/apache/mina/example/src/main/java/org/apache/mina/example/tapedeck/Main.java:[69,19]
cannot find symbol
symbol  : class StateMachineProxyBuilder
location: class org.apache.mina.example.tapedeck.Main


[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27 seconds
[INFO] Finished at: Fri Apr 04 14:27:15 CEST 2008
[INFO] Final Memory: 23M/41M
[INFO] ------------------------------------------------------------------------


/niklas

Re: Make LoggingFilter.log() protected

Posted by Julien Vermillard <jv...@archean.fr>.
On Fri, 4 Apr 2008 13:48:37 +0200
"Niklas Gustavsson" <ni...@protocol7.com> wrote:

> 2008/4/4 Niklas Gustavsson <ni...@protocol7.com>:
> >  It's not a lot of work, but it's a route I would like to avoid.
> > Anyways, thanks!
> 
> To pick up this change, how are snapshots of MINA published? Would it
> be possible to push a new?
> 
> /niklas
Hi,

You can easly deploy snapshot with this guide :
http://mina.apache.org/developer-guide.html#DeveloperGuide-DeployingSnapshots%28CommitersOnly%29

Julien

Re: Make LoggingFilter.log() protected

Posted by Niklas Gustavsson <ni...@protocol7.com>.
2008/4/4 Niklas Gustavsson <ni...@protocol7.com>:
>  It's not a lot of work, but it's a route I would like to avoid. Anyways, thanks!

To pick up this change, how are snapshots of MINA published? Would it
be possible to push a new?

/niklas

Re: Make LoggingFilter.log() protected

Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Fri, Apr 4, 2008 at 1:04 PM, "이희승 (Trustin Lee) <tr...@gmail.com> wrote:
> Hi Niklas,
>
>  Are you using a String as a message type?  Otherwise you could override
>  toString() so you can mask the password.  I'd suggest you to create a
>  message class for each message type as defined in FTP.

No, we're using a gernic FtpRequest type. I was thinking about
handling this in toString (which we don't currently implement so it
would be a safe change), however, there might be places where we
actually would like to get the real content on the PASS command from
toString() (like in a specific authentication log), so I choose not.

>  However, it will take a lot of effort, and therefore I think making
>  LoggingFilter.log() protected makes sense.  Let me create an issue and
>  resolve it right now.

It's not a lot of work, but it's a route I would like to avoid. Anyways, thanks!

/niklas

Re: Make LoggingFilter.log() protected

Posted by 이희승 (Trustin Lee) <t...@gmail.com>.
Hi Niklas,

Are you using a String as a message type?  Otherwise you could override
toString() so you can mask the password.  I'd suggest you to create a
message class for each message type as defined in FTP.

However, it will take a lot of effort, and therefore I think making
LoggingFilter.log() protected makes sense.  Let me create an issue and
resolve it right now.

Niklas Gustavsson wrote:
> Hi
> 
> I would like to create a custom logging filter for use in FtpServer,
> the reason is to mask out the password sent in the PASS command from
> logs. Here's the RFE:
> https://issues.apache.org/jira/browse/FTPSERVER-120
> 
> To make this reasonably straight-forward without forking the current
> LoggingFIlter, I'm wondering if you would be okay with changing the
> LoggingFilter.log method from private to protected?
> 
> /niklas

-- 
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/