You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Chaminda Amarasinghe <ch...@gmail.com> on 2009/10/30 08:50:34 UTC

PatternLayout

Hi All,

I have few components with java package structure
com.<company_name>.<component_name>.<rest_of_packages_of_this_component>

For example 
com.mycompany.component1.subpackage1.Class1
com.mycompany.component1.subpackage1.Class2
com.mycompany.component1.subpackage2.Class1
com.mycompany.component2.subpackage1.Class1
com.mycompany.component2.subpackage1.Class2
com.mycompany.component2.subpackage2.Class1

I want to show just the component name as a prefix in log entry. That means
component1 or componet2. Not the com.mycompany or subpackage.Class

I know that %c{3} will log component.subpackage.Class and %C{2} will log
subpackage.Class and so on

How I can do that, If I have to override some classes what are those and
how?

Any help greatly appreciate

Cheers
Chaminda 
-- 
View this message in context: http://old.nabble.com/PatternLayout-tp26126158p26126158.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org