Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add lineSeparator field instead of inline - use SeparatorParser.parse…
…Separator()
  • Loading branch information
Damien Ferey committed May 19, 2022
commit 11c99a3feb28a8dd657bac3fefa767e65b39374e
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import ch.qos.logback.core.boolex.EvaluationException;
import ch.qos.logback.core.boolex.EventEvaluator;
import ch.qos.logback.core.status.ErrorStatus;
import net.logstash.logback.encoder.SeparatorParser;

/**
* A {@link ThrowableHandlingConverter} (similar to logback's {@link ThrowableProxyConverter})
Expand Down Expand Up @@ -303,8 +304,24 @@ public String getLineSeparator() {
return lineSeparator;
}

/**
* Sets which lineSeparator to use between events.
* <p>
*
* The following values have special meaning:
* <ul>
* <li>{@code null} or empty string = no new line.</li>
* <li>"{@code SYSTEM}" = operating system new line (default).</li>
* <li>"{@code UNIX}" = unix line ending ({@code \n}).</li>
* <li>"{@code WINDOWS}" = windows line ending {@code \r\n}).</li>
* </ul>
* <p>
* Any other value will be used as given as the lineSeparator.
*
* @param lineSeparator the line separator
*/
public void setLineSeparator(String lineSeparator) {
this.lineSeparator = lineSeparator;
this.lineSeparator = SeparatorParser.parseSeparator(lineSeparator);
}

/**
Expand Down