Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

Log4j Debug and Info

Thread view: 
akhileshkokardekar@gmail.com - 23 Jan 2007 11:33 GMT
Hi All,

I have started using log4j recently. I have tried to put both INFO and
DEBUG on console and in a file but it throws an exception

log4j:ERROR Attempted to append to closed appender named [Console].
log4j:ERROR Attempted to append to closed appender named [RollingFile].

So can i conclude that INFO and DEBUG information cannot be generated
simultaneously. If i am using only INFO or only DEBUG it is working
fine.

Waiting for your response guys...

Regards,
Akhilesh
Lew - 24 Jan 2007 00:22 GMT
> Hi All,
>
[quoted text clipped - 7 lines]
> simultaneously. If i am using only INFO or only DEBUG it is working
> fine.

I don't know what you mean by "simultaneously". Are you suggesting some sort
of ORing of levels, as logger.log( INFO + DEBUG, msg )? That would be
meaningless, since DEBUG < INFO. If a DEBUG message would log, so would an
INFO message.

Are you simply saying you want to issue log statements at different levels
from the same code, as

...
    logger.log( INFO, msgA );
    logger.log( DEBUG, msgB );
?

That is not only possible in log4j, it is a favoured idiom.

However, if your appender is closed you cannot log anything.

<http://logging.apache.org/log4j/docs/manual.html>

- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.