wttech/gradle-aem-plugin

Support custom date format patterns in log tailer

Closed this issue · 1 comments

when sling log format is customized and log contains such entries:

2021-05-20 13:50:00.006 *WARN* [sling-default-4-Registered Service.7414] org.apache.

instead of e.g

30.04.2021 07:00:04.924 *INFO* [pool-21-thread-1] com.adobe.granite

then no logs are printed to console, most probably because of hardcoded formats here:

https://github.com/wttech/gradle-aem-plugin/blob/master/src/main/kotlin/com/cognifide/gradle/aem/common/instance/tail/Log.kt#L48-L62

in other words, GAP should acceept configuration parameter log pattern, best if the format string will be same as in LogManager

PID: org.apache.sling.commons.log.LogManager-error

org.apache.sling.commons.log.pattern="\{0,date,yyyy-MM-dd HH:mm:ss.SSS} *\{4}* [\{2}] \{3} \{5}"

e.g gradle.properties:

instance.tail.logFilePath=/logs/error.log
instance.tail.logPattern=\{0,date,yyyy-MM-dd HH:mm:ss.SSS} *\{4}* [\{2}] \{3} \{5}