mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Roberts <dave.robe...@saaconsultants.com>
Subject Re: [FTPServer] Plans for Logging
Date Tue, 26 Feb 2008 15:37:26 GMT
Niklas Gustavsson wrote:
> On Tue, Feb 26, 2008 at 3:50 PM, Dave Roberts
> <dave.roberts@saaconsultants.com> wrote:
>>  So, will all LOG writes (e.g. PASS.java:215) be replaced with this
>>  new logging functionality?
> 
> There should be no need for that. The MINA MdcInjectionFilter sets
> some things for us (handlerClass, remoteAddress, localAddress,
> remoteIp, remotePort, localIp, localPort) and we provide some

That answers another question. Thanks :)

>>  If so, can we also expose the FtpIoSession to things like the
>>  FileSystemManager, FileSystemView and FileSystemObject, as well as
>>  the Ftplet implementations, such that other implementations can make
>>  use of the logging as well.
> 
> That would be completely transparent, no changes required. Just add
> the normal log statements where needed and the MDC context will be
> handled for them.

OK, I see what you're saying, but that doesn't seem to be how it
works.  For example...

(NioProcessor-2) [anonymous] [127.0.0.1] SENT: 331 Guest login okay,
send your complete e-mail address as password.
(NioProcessor-2) [anonymous] [127.0.0.1] RECEIVED: PASS dave@
(pool-1-thread-2) [] [] Anonymous login success - dave@
(NioProcessor-2) [anonymous] [127.0.0.1] SENT: 230 User logged in,
proceed.

The log of the successful login comes from the PASS class, with a
simple LOG.info() call.  None of the MDC information is filled in there.

>>  In terms of the information stored in the MDC attributes, I think
>>  we'd benefit from something unique, like the client host _and_
>>  client port, or a hex version of the connection timestamp.
> 
> You mean a session identifier?

I do, but if the remote port is already stored in the MDC
attributes, then that can be used by anyone that needs such
granularity, in conjunction with the remote IP.


Mime
View raw message