Class LogLineTagger


  • public class LogLineTagger
    extends Object
    This class can tag lines in a log message before the message is written. The tags include the log level, the message tag (identification of the source) and the current date and time.
    • Constructor Detail

      • LogLineTagger

        public LogLineTagger()
    • Method Detail

      • tagLines

        public static String tagLines​(int level,
                                      String tag,
                                      org.joda.time.DateTime time,
                                      String msg)
        Tags every line in the specified message. It will prefix every line with the log level, the tag and the current date and time. Every line will end with a new line character, including the last line.
        Parameters:
        level - the log level
        tag - the tag
        time - the current date and time
        msg - the log message
        Returns:
        the log message with tagged lines