On Jan 17, 2007, at 12:17 AM, Lisa wrote:


I was under the impression that name="org.apache.myfaces" property of <logger> for example would be the way the logger knew to only log debug/info from
everything containing that package name.

<P>
If I name it anything I want, like name="idMyfaces" how does the logger limit
output confined to "org.apache.myfaces.*" ?

<P>
Is there something I am missing?

<P>
Lisa



Log4j does not impose a logging strategy, but it allows a large number of different strategies. A common strategy would be to use loggers named with the same name as the class name which would allow you to segregate messages from a particular class or package. However, another developer might want to segregate messages by function or audience and could use logger names like "database.user.update", "audit", "finance.debit". The essential aspect is not the names of the classes, but the names of the loggers used within the implementation (knowing that they may, but aren't required to be the same).

I would suggest starting with a very simple configuration file where a file appender is attached to the root logger with a pattern layout that contains %c so the logger name appears in the output. After you have collected a sample log, examine the logger names that are actually used by your application. At that point, you could post another message with excerpts of the captured log file and a description of what you would like suppressed.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to