You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Danilo Rosetto Muñoz <mu...@gmail.com> on 2010/12/09 15:22:18 UTC

Re: Logging level

Hi all!

Sorry for the late answer ... I was in other project and now get back again.

I could resolve the logging per package using log4j. Here go my properties
file:

> log4j.rootLogger=info, file

log4j.logger.org.apache.ftpserver=info, fileftp


> log4j.appender.file.MaxBackupIndex=4

log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %t %5p %c{1}\:%L -
> %m%n

log4j.appender.file.layout=org.apache.log4j.PatternLayout

log4j.appender.file.File=./log/myapp-log.log

log4j.appender.file=org.apache.log4j.RollingFileAppender

log4j.appender.file.MaxFileSize=25MB


> log4j.appender.fileftp.MaxBackupIndex=4

log4j.appender.fileftp.layout.ConversionPattern=%d{ISO8601} %t %5p %c{1}\:%L
> - %m%n

log4j.appender.fileftp.layout=org.apache.log4j.PatternLayout

log4j.appender.fileftp.File=./log/myapp-ftp-log.log

log4j.appender.fileftp=org.apache.log4j.RollingFileAppender

log4j.appender.fileftp.MaxFileSize=25MB



Now, I could notice that I get not so much information through
FtpLoggingFilter.
Samples:

> 2010-12-09 12:15:35,101 pool-3-thread-7  INFO FtpLoggingFilter:84 -
> RECEIVED: QUIT

2010-12-09 12:15:35,105 pool-3-thread-7  INFO FtpLoggingFilter:140 - SENT:
> 221 Goodbye.

2010-12-09 12:15:35,106 pool-3-thread-7  INFO FtpLoggingFilter:158 - CLOSED

2010-12-09 12:19:39,663 pool-3-thread-8  WARN PASS:170 - User failed to log
> in

2010-12-09 12:19:40,163 pool-3-thread-8  WARN PASS:213 - Login failure - a

2010-12-09 12:19:40,165 pool-3-thread-8  INFO FtpLoggingFilter:140 - SENT:
> 530 Authentication failed.


Once I have many client, how is the best way to get IP address on this log?
I want to be able to identify which client am I getting problems, error, or
authentication problems?

Thanks a lot,

On Tue, Nov 9, 2010 at 7:08 AM, David Latorre <dv...@gmail.com> wrote:

> Those are logginf frameworks that can be used with FTPServer, which logging
> framekwork are you using?
>
>
> -----Mensaje original-----
> De: Danilo Rosetto Muñoz [mailto:munozdanilo@gmail.com]
> Enviado el: lunes, 08 de noviembre de 2010 17:43
> Para: ftpserver-users@mina.apache.org
> Asunto: Re: Logging level
>
> David,
>
> Sorry, but what do you mean with "log4j/jul/logback" ?
>
> Thank you!
>
>
>
> On Mon, Nov 8, 2010 at 2:14 PM, David Latorre <dv...@gmail.com> wrote:
>
> > Hello Danilo,
> >
> >  You can set the log levels individually according to the logger name
> > (which usually is equal to the name of the class that instantiated the
> > logger) . Something like this should be possible:
> >
> >  com.your.enterpise.yourapp = DEBUG
> >  org.apache.ftpserver = ERROR
> >
> >
> > See the log4j/jul/logback documentation for the specific syntax for
> > your logging package.
> >
> >
> > 2010/11/8 Danilo Rosetto Muñoz <mu...@gmail.com>:
> > > Hi,
> > >
> > > I checked http://mina.apache.org/ftpserver/logging.html page. So once
> > the
> > > log is configured through properties file, I believe that its
> impossible
> > set
> > > some filter like we have in XML configuration log files.
> > >
> > > The problem is that I am embedding FTP server on my app and I get too
> > many
> > > logging from FTP. I wouldn´t like to set up my app logging level. So,
> > lets
> > > summarize my question: How to separate my app and FTP server logging?
> May
> > I
> > > do that at run time?
> > >
> > > Thanks a lot,
> > >
> > > --
> > > Danilo Rosetto Muñoz
> > > munozdanilo@gmail.com
> > > http://munozdanilo.googlepages.com
> > >
> >
>
>
>
> --
> Danilo Rosetto Muñoz
> munozdanilo@gmail.com
> http://munozdanilo.googlepages.com
>
>


-- 
Danilo Rosetto Muñoz
munozdanilo@gmail.com
http://br.linkedin.com/in/danilomunoz

Re: Logging level

Posted by Danilo Rosetto Muñoz <mu...@gmail.com>.
Hi David!

Very useful information! Thanks a lot! This probably will help me a lot.
Just a question: where did you found this kind of information?

Best regards,

On Thu, Dec 9, 2010 at 3:32 PM, David Latorre <dv...@gmail.com> wrote:

> 2010/12/9 Danilo Rosetto Muñoz <mu...@gmail.com>:
> > Hi all!
> >
> > Sorry for the late answer ... I was in other project and now get back
> again.
> >
> > I could resolve the logging per package using log4j. Here go my
> properties
> > file:
> >
> >> log4j.rootLogger=info, file
> >
> > log4j.logger.org.apache.ftpserver=info, fileftp
> >
> >
> >> log4j.appender.file.MaxBackupIndex=4
> >
> > log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %t %5p %c{1}\:%L
> -
> >> %m%n
> >
> > log4j.appender.file.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.file.File=./log/myapp-log.log
> >
> > log4j.appender.file=org.apache.log4j.RollingFileAppender
> >
> > log4j.appender.file.MaxFileSize=25MB
> >
> >
> >> log4j.appender.fileftp.MaxBackupIndex=4
> >
> > log4j.appender.fileftp.layout.ConversionPattern=%d{ISO8601} %t %5p
> %c{1}\:%L
> >> - %m%n
> >
> > log4j.appender.fileftp.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.fileftp.File=./log/myapp-ftp-log.log
> >
> > log4j.appender.fileftp=org.apache.log4j.RollingFileAppender
> >
> > log4j.appender.fileftp.MaxFileSize=25MB
> >
> >
> >
> > Now, I could notice that I get not so much information through
> > FtpLoggingFilter.
> > Samples:
> >
> >> 2010-12-09 12:15:35,101 pool-3-thread-7  INFO FtpLoggingFilter:84 -
> >> RECEIVED: QUIT
> >
> > 2010-12-09 12:15:35,105 pool-3-thread-7  INFO FtpLoggingFilter:140 -
> SENT:
> >> 221 Goodbye.
> >
> > 2010-12-09 12:15:35,106 pool-3-thread-7  INFO FtpLoggingFilter:158 -
> CLOSED
> >
> > 2010-12-09 12:19:39,663 pool-3-thread-8  WARN PASS:170 - User failed to
> log
> >> in
> >
> > 2010-12-09 12:19:40,163 pool-3-thread-8  WARN PASS:213 - Login failure -
> a
> >
> > 2010-12-09 12:19:40,165 pool-3-thread-8  INFO FtpLoggingFilter:140 -
> SENT:
> >> 530 Authentication failed.
> >
> >
> > Once I have many client, how is the best way to get IP address on this
> log?
> > I want to be able to identify which client am I getting problems, error,
> or
> > authentication problems?
>
> You can configure this in your log4j.properties. An pattern you can
> use as an example is:
>
> log4j.appender.File.layout.ConversionPattern=>>>[%d{dd MMM yyyy
> HH:mm:ss,SSS}] IP:%X{remoteIp}:%X{remotePort} - Thread:%t, Class:  %c,
> %p %m %n
>
>
>
>
>
> > Thanks a lot,
> >
> > On Tue, Nov 9, 2010 at 7:08 AM, David Latorre <dv...@gmail.com> wrote:
> >
> >> Those are logginf frameworks that can be used with FTPServer, which
> logging
> >> framekwork are you using?
> >>
> >>
> >> -----Mensaje original-----
> >> De: Danilo Rosetto Muñoz [mailto:munozdanilo@gmail.com]
> >> Enviado el: lunes, 08 de noviembre de 2010 17:43
> >> Para: ftpserver-users@mina.apache.org
> >> Asunto: Re: Logging level
> >>
> >> David,
> >>
> >> Sorry, but what do you mean with "log4j/jul/logback" ?
> >>
> >> Thank you!
> >>
> >>
> >>
> >> On Mon, Nov 8, 2010 at 2:14 PM, David Latorre <dv...@gmail.com> wrote:
> >>
> >> > Hello Danilo,
> >> >
> >> >  You can set the log levels individually according to the logger name
> >> > (which usually is equal to the name of the class that instantiated the
> >> > logger) . Something like this should be possible:
> >> >
> >> >  com.your.enterpise.yourapp = DEBUG
> >> >  org.apache.ftpserver = ERROR
> >> >
> >> >
> >> > See the log4j/jul/logback documentation for the specific syntax for
> >> > your logging package.
> >> >
> >> >
> >> > 2010/11/8 Danilo Rosetto Muñoz <mu...@gmail.com>:
> >> > > Hi,
> >> > >
> >> > > I checked http://mina.apache.org/ftpserver/logging.html page. So
> once
> >> > the
> >> > > log is configured through properties file, I believe that its
> >> impossible
> >> > set
> >> > > some filter like we have in XML configuration log files.
> >> > >
> >> > > The problem is that I am embedding FTP server on my app and I get
> too
> >> > many
> >> > > logging from FTP. I wouldn´t like to set up my app logging level.
> So,
> >> > lets
> >> > > summarize my question: How to separate my app and FTP server
> logging?
> >> May
> >> > I
> >> > > do that at run time?
> >> > >
> >> > > Thanks a lot,
> >> > >
> >> > > --
> >> > > Danilo Rosetto Muñoz
> >> > > munozdanilo@gmail.com
> >> > > http://munozdanilo.googlepages.com
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Danilo Rosetto Muñoz
> >> munozdanilo@gmail.com
> >> http://munozdanilo.googlepages.com
> >>
> >>
> >
> >
> > --
> > Danilo Rosetto Muñoz
> > munozdanilo@gmail.com
> > http://br.linkedin.com/in/danilomunoz
> >
>



-- 
Danilo Rosetto Muñoz
munozdanilo@gmail.com
http://br.linkedin.com/in/danilomunoz

Re: Logging level

Posted by David Latorre <dv...@gmail.com>.
2010/12/9 Danilo Rosetto Muñoz <mu...@gmail.com>:
> Hi all!
>
> Sorry for the late answer ... I was in other project and now get back again.
>
> I could resolve the logging per package using log4j. Here go my properties
> file:
>
>> log4j.rootLogger=info, file
>
> log4j.logger.org.apache.ftpserver=info, fileftp
>
>
>> log4j.appender.file.MaxBackupIndex=4
>
> log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %t %5p %c{1}\:%L -
>> %m%n
>
> log4j.appender.file.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.file.File=./log/myapp-log.log
>
> log4j.appender.file=org.apache.log4j.RollingFileAppender
>
> log4j.appender.file.MaxFileSize=25MB
>
>
>> log4j.appender.fileftp.MaxBackupIndex=4
>
> log4j.appender.fileftp.layout.ConversionPattern=%d{ISO8601} %t %5p %c{1}\:%L
>> - %m%n
>
> log4j.appender.fileftp.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.fileftp.File=./log/myapp-ftp-log.log
>
> log4j.appender.fileftp=org.apache.log4j.RollingFileAppender
>
> log4j.appender.fileftp.MaxFileSize=25MB
>
>
>
> Now, I could notice that I get not so much information through
> FtpLoggingFilter.
> Samples:
>
>> 2010-12-09 12:15:35,101 pool-3-thread-7  INFO FtpLoggingFilter:84 -
>> RECEIVED: QUIT
>
> 2010-12-09 12:15:35,105 pool-3-thread-7  INFO FtpLoggingFilter:140 - SENT:
>> 221 Goodbye.
>
> 2010-12-09 12:15:35,106 pool-3-thread-7  INFO FtpLoggingFilter:158 - CLOSED
>
> 2010-12-09 12:19:39,663 pool-3-thread-8  WARN PASS:170 - User failed to log
>> in
>
> 2010-12-09 12:19:40,163 pool-3-thread-8  WARN PASS:213 - Login failure - a
>
> 2010-12-09 12:19:40,165 pool-3-thread-8  INFO FtpLoggingFilter:140 - SENT:
>> 530 Authentication failed.
>
>
> Once I have many client, how is the best way to get IP address on this log?
> I want to be able to identify which client am I getting problems, error, or
> authentication problems?

You can configure this in your log4j.properties. An pattern you can
use as an example is:

log4j.appender.File.layout.ConversionPattern=>>>[%d{dd MMM yyyy
HH:mm:ss,SSS}] IP:%X{remoteIp}:%X{remotePort} - Thread:%t, Class:  %c,
%p %m %n





> Thanks a lot,
>
> On Tue, Nov 9, 2010 at 7:08 AM, David Latorre <dv...@gmail.com> wrote:
>
>> Those are logginf frameworks that can be used with FTPServer, which logging
>> framekwork are you using?
>>
>>
>> -----Mensaje original-----
>> De: Danilo Rosetto Muñoz [mailto:munozdanilo@gmail.com]
>> Enviado el: lunes, 08 de noviembre de 2010 17:43
>> Para: ftpserver-users@mina.apache.org
>> Asunto: Re: Logging level
>>
>> David,
>>
>> Sorry, but what do you mean with "log4j/jul/logback" ?
>>
>> Thank you!
>>
>>
>>
>> On Mon, Nov 8, 2010 at 2:14 PM, David Latorre <dv...@gmail.com> wrote:
>>
>> > Hello Danilo,
>> >
>> >  You can set the log levels individually according to the logger name
>> > (which usually is equal to the name of the class that instantiated the
>> > logger) . Something like this should be possible:
>> >
>> >  com.your.enterpise.yourapp = DEBUG
>> >  org.apache.ftpserver = ERROR
>> >
>> >
>> > See the log4j/jul/logback documentation for the specific syntax for
>> > your logging package.
>> >
>> >
>> > 2010/11/8 Danilo Rosetto Muñoz <mu...@gmail.com>:
>> > > Hi,
>> > >
>> > > I checked http://mina.apache.org/ftpserver/logging.html page. So once
>> > the
>> > > log is configured through properties file, I believe that its
>> impossible
>> > set
>> > > some filter like we have in XML configuration log files.
>> > >
>> > > The problem is that I am embedding FTP server on my app and I get too
>> > many
>> > > logging from FTP. I wouldn´t like to set up my app logging level. So,
>> > lets
>> > > summarize my question: How to separate my app and FTP server logging?
>> May
>> > I
>> > > do that at run time?
>> > >
>> > > Thanks a lot,
>> > >
>> > > --
>> > > Danilo Rosetto Muñoz
>> > > munozdanilo@gmail.com
>> > > http://munozdanilo.googlepages.com
>> > >
>> >
>>
>>
>>
>> --
>> Danilo Rosetto Muñoz
>> munozdanilo@gmail.com
>> http://munozdanilo.googlepages.com
>>
>>
>
>
> --
> Danilo Rosetto Muñoz
> munozdanilo@gmail.com
> http://br.linkedin.com/in/danilomunoz
>