This is possible, but with quite ugly syntax. I always wanted to add some syntactic sugar, but never got around to do it.
It looks like this:
junction {
channel {
# if, with conditions specified as filters
filter { whatever... };
destination { whatever };
flags(final);
};
channel {
# else, you can add filters as well
destination { something else };
flags(final);
};
};
The key parts:
* This can be embedded to any log statement as it is
* It uses inline filters and destinations, but you can use other definitions by using simple parens instead of braces.
* flags final which causes processing to be stopped at the first match. Without that, you'd be duplicating messages, if the conditions overlap.
* You can add any number of channels, you are not limited to one if/else construct. It is more like a filter based switch with multple potential branches.
Hope this helps,