in reply to Re: log4perl in module appending to callers log file
in thread log4perl in module appending to callers log file

Thanks for the reply. I wanted this behavior where called module logs to the caller script's appenders. The only logical difference I see from your code is that you have used rootLogger and I've used my logger.testLog. I'm also calling get_logger in the module but looks like calling get_logger("") in the module writes to rootLogger and not custom logger.

And so I was not able to get the logs from the called module into the caller appenders.

Do you know if there is any other way If I don't use the rootLogger and also doesn't specify the target logger name in the called module?
  • Comment on Re^2: log4perl in module appending to callers log file

Replies are listed 'Best First'.
Re^3: log4perl in module appending to callers log file
by wwe (Friar) on Aug 02, 2011 at 09:29 UTC
    I'm not a guru but this is a way I used Log4Perl. I don't know a reference but I think there is a logging hierarchy in other words there is a parent logger where all other logger depend on. And the logger on the top is a root logger. Maybe called modules look for this specific logger where they can append to. This config works fine for me so I don't care much about the thing behind it...