On 6/13/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm new to JAVA and log4j, but I created a singleton object to be my logger that is used by all the classes in a single threaded project I'm working on.. Is this bad? I suppose I didn't know how to use the log4j api correctly, but I was getting duplicate records in my logs, so I created a singleton object that every other object uses and it solved my problem (no more duplicate entries in my logs).
Hi! While your approach works, it isn't the ideal way - using a single logger will hinder you if you need to split logs, sort them by component, etc. With regards to your duplicate logging problem, I'll bet you added the same appender to both the root logger and your app logger. (search in the mailing list archives, the duplicate logging problem has been addressed multiple times :) -- Javier González Nicolini --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
