views:

24

answers:

1

I'm using log4net with the following partial conversion pattern:

%logger{2}

This outputs the last two dot separated tokens of the logger name. For example, a logger named Foo.Bar.Baz.Qux will be displayed as Baz.Qux. Great.

Is there a partial conversion pattern syntax to specify "everything except for the first two dot separated tokens of the logger name"? For example, i'd like the logger "Foo.Bar.Baz.Qux.Quux" to be displayed as "Baz.Qux.Quux".

+1  A: 

There is no such syntax. You could write your own pattern converter though. Here is a sample of a pattern converter. As you can see it is quite easy to do that. If you are interested I can post later the code of a converter that would meed your requirements...

Stefan Egli