The Toothpick Logo

CompositeLoggingPolicy

For tricky logging situations, you should use a CompositeLoggingPolicy. This LoggingPolicy consists of a Set of LoggingEventPatterns, and will log an event if it matches any of the patterns.

	| pattern1 pattern2 policy |
	pattern1 := LoggingEventPattern fromString: 'debug.debug'.
	pattern2 := LoggingEventPattern fromString: 'info,perf.=debug'.
	policy := CompositeLoggingPolicy new.
	policy
		addPattern: pattern1;
		addPattern: pattern2.
This policy will log all events from the debug category with a level of debug or above, and all events from either the info or perf categories that have a level of debug. For an explanation of the event pattern syntax, see LoggingEventPattern.


Published Thursday, October 19, 2006
supported dialects