Implement prefix stripping.

This is useful when the caller does not have control over the installation
paths and thus cannot adjust the paths when defining the loggers, or when
the loggers' configuration is done by end-users directly.