In log4j, How do we represent more than one spaces (like : \s+) in the pattern?
I have a pattern like this %d{ISO8601}\t%t\t%m %n, but the tab-separation is not reliable when I was parsing through chainsaw and LogMX. I am searching for replacement of multiple-space-separated rather than tab-separated , but I cannot find any.
Any help is appreciated. Thank you.
The layout pattern in log4j is not a regular expression pattern, and is not used to search for strings. As its name idicates, it is used for laying out the message to be priinted by log4j. With something like \s+, how would it know how many spaces to print? Therefore, if you need multiple spaces in the message layout, you have to explicitely type these spaces in the pattern.