The naming hierarchy enables destination assignment.
static final Location parent = Location.getLocation("com.sapmarkets"), Location child = Location.getLocation("com.sapmarkets.foo"); parent.fatalT("A fatal message from parent"); child.fatalT("A fatal message from children"); |
Both messages will be output to the console, even though ConsoleLog is assigned only to the parent node.
Multiple destinations are permitted. The assignment of logs to a source object is additive. There is no race condition.
There are two messages printed in the console (each from parent and child), while in the output file, messages from child are also printed in addition to the console destination.
You can suppress this inheritance feature in certain circumstances to tune the output behavior.
More information: Output File.