We are currently not able to monitor our Pega logs files correctly in ELK and need to create a separate logger in JSON format that be consumed correctly. I believe the steps below would need to be followed but would be grateful for a confirmation if anyone else done similar:
Pega uses Log4j2 with plain-text pattern layouts, though it does support natively logging through JSON layout.
- We need to locate the prlog4j2.jar and extract log4j2.xml
- Create a custom appender that uses JSON layout e.g.:
- Attach it to the root logger e.g.:
<AppenderRef=“JsonFile”/>
Note: Pega upgrades will overwrite the log4j2.