Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.

Logging problem.

no avatar
User

Lars

Posts

6

Joined

Thu Oct 04, 2007 8:14 pm

Logging problem.

by Lars » Thu Oct 04, 2007 8:19 pm

Hi,
I when I upgraded from edtftpj-1.5.2 to edtftp-1.5.5 it stopped logging. I?m using log4j-1.2.14.
When I went back to 1.5.2 it started working again. Is there any changes that need to be done when upgrading to get logging to work?

I'm starting the appliction with -Dedtftp.log.level=DEBUG -Dedtftp.log.log4j=true.

log4j configuration:
...
log4j.category.com.enterprisedt=DEBUG, FTP
log4j.additivity.com.enterprisedt=false
...
log4j.appender.FTP=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FTP.File=#DIST@BASE_DEPLOY_PATH@DIST#/hitee/data/logs/ftp.log
log4j.appender.FTP.DatePattern='.'yyyy-MM-dd
log4j.appender.FTP.layout=org.apache.log4j.PatternLayout
log4j.appender.FTP.layout.ConversionPattern=%d{HH:mm:ss} %-5p [%t] [%x] - %m%n
...
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Logging problem.

by support2 » Thu Oct 04, 2007 10:51 pm

It should work, unless we've made a change that has broken log4j integration. Any clues that point to anything? Is the only change the new edtftpj.jar file?
no avatar
User

Lars

Posts

6

Joined

Thu Oct 04, 2007 8:14 pm

by Lars » Fri Oct 05, 2007 12:11 am

Thanks for the quick response.
Yes, all I did to get it to work again was to rebuild and deploy with the old jar (1.5.2).
I?ll take a closer look next week when I get some spare time.
no avatar
User

Lars

Posts

6

Joined

Thu Oct 04, 2007 8:14 pm

by Lars » Sat Oct 06, 2007 1:19 am

Hi,
I found what caused the problem.
In the 1.5.2 version loggers were obtained as follows:
private Logger log = Logger.getLogger(FTPControlSocket.class);
In the 1.5.5:
private static Logger log = Logger.getLogger("FTPControlSocket");

Setting logging for the classes in the ?com.enterprisedt? package is no longer possible as the loggers are not obtained with the package name (or class object).
Is this change intentional?

Regards
Lars
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Sat Oct 06, 2007 9:13 pm

no avatar
User

Lars

Posts

6

Joined

Thu Oct 04, 2007 8:14 pm

by Lars » Mon Oct 08, 2007 5:33 pm

no avatar
User

Yeroc

Posts

4

Joined

Wed Apr 02, 2008 1:12 am

by Yeroc » Thu Apr 29, 2010 1:28 am

I just ran into this same issue. It's really painful having the Loggers named by the class name only without the package name because it makes it nearly impossible to control the logging level. As above, Log4j (and most other) logging systems are designed to be hierachical making it easy to turn on/off logging at the package level. I'm using v2.0.5, is there a plan to fix this anytime soon. Do you accept patches? I would point out that if you're using obfuscation for some reason but keep the Loggers named with their actual class name you've mostly defeated the obfuscation anyhow so I'm not sure why you don't just go back to using class.getName()?

Thanks,
Corey
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Fri Apr 30, 2010 8:31 am

We do use this in proprietary code which gets obfuscated. The name of the class is only a minor part of obfuscation.

However we'll discuss use of package names ... that obviously would be useful.

Who is online

Users browsing this forum: No registered users and 112 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron