Logtrace is a component that could output the log into either a device or a file. It has the ability to filter the log messages according to a pre-module level. Define RT_USING_LOGTRACE in rtconfig.h if you want to have a try.