I have two Java classes that used log4j. 
curam.tools.upgradehelper.ieg.QuestionSequenceOrderConverter
and
curam.tools.upgradehelper.taskredirection.TaskRedirectionConverter

Both classes from above uses different class:
curam.tools.upgradehelper.util.SQLStatements
where a logger in each of the class with defined in following pattern:
private static final Logger log = Logger.getLogger(NameOfTheClass.class);


Next I have defined log4j.xml. I want to have a full log file in two
separate files for both classes.
curam.tools.upgradehelper.ieg.QuestionSequenceOrderConverter in
QuestionSequenceOrderConverterTool.log
curam.tools.upgradehelper.taskredirection.TaskRedirectionConverter in
TaskRedirectionConverterTool.log

I did a following:

    
        
        
        
        
        
            
        
    


    
        
        
        
        
        
            
        
    

    
        
        
         

    
        
        
    


I have not defined root at all.

My assumption was that if I run one of the class
curam.tools.upgradehelper.ieg.QuestionSequenceOrderConverter I would got 
all the logs from that class and allthe classes used internaly by
curam.tools.upgradehelper.ieg.QuestionSequenceOrderConverter in the
addQuestionSequenceOrderTool.log.

Instead I got an log4j warning:
log4j:WARN No appenders could be found for logger
(curam.tools.upgradehelper.util.SQLStatements).

What is the  meaning of the attribute "additivity" for each logger?
Why don't  I get all the logs in one file?


During my testing I have defined a root logger as well.

    
        
        
        
    

but it does not do what I want. All  the expected lines are present in both
files but the files are populated with the log from the same class.



Could anybody help me with defining a correct log4j.xml file?



-- 
View this message in context: 
http://www.nabble.com/additivity-attribute-for-logger-does-not-diffrently-for-root-and-user-defined-logger.-tp18259080p18259080.html
Sent from the Log4j - Users mailing list archive at Nabble.com.

Reply via email to