diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt index 37a79bb..61166a1 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/Processor.kt @@ -115,13 +115,11 @@ class Processor private constructor() { if ( (channelconf.sanitizeMessage ?: ChannelSettings.global.sanitizeMessage) != false && (channelconf.permitFormatting ?: ChannelSettings.global.permitFormatting) != false - ) - message = message.replace("<", "\\<") + ) message = message.replace("<", "\\<") if ( ((channelconf.permitFormatting ?: ChannelSettings.global.permitFormatting) != false) && LoggerConfiguration.features.contains(Feature.FORMATTING) - ) - format.addFeature(Feature.FORMATTING) + ) format.addFeature(Feature.FORMATTING) // Set message format.message = message diff --git a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt index 551e102..da6df9f 100644 --- a/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt +++ b/logging/src/main/kotlin/de/staropensource/engine/logging/implementation/SOSLSv2FormatBuilder.kt @@ -91,20 +91,20 @@ class SOSLSv2FormatBuilder(call: Call) : FormatBuilder(call) { format.append("[") if (enabledFeatures.contains(Feature.DATE)) format - .append(datetime.dayOfMonth) + .append("%02d".format(datetime.dayOfMonth.toString())) .append(".") - .append(datetime.monthNumber) + .append("%02d".format(datetime.monthNumber)) .append(".") - .append(datetime.year) + .append("%04d".format(datetime.year)) if (enabledFeatures.contains(Feature.DATE) && enabledFeatures.contains(Feature.TIME)) format.append(" ") if (enabledFeatures.contains(Feature.TIME)) format - .append(datetime.hour) + .append("%02d".format(datetime.hour)) .append(":") - .append(datetime.minute) + .append("%02d".format(datetime.minute)) .append(":") - .append(datetime.second) + .append("%02d".format(datetime.second)) if (enabledFeatures.contains(Feature.DATE) || enabledFeatures.contains(Feature.TIME)) format.append("] ") }