2018-08-27 15:36:20,231 2018-08-27 06:36:20,221 GMT*8*PEGA0005*1047*500*8d3dfbbcbe7edb849a519edc9976cfa9*NA*NA*NA*NA*NA*NA*NA*?*-1**0*NA*NA*com.pega.pegarules.data.internal.store.DataStorePreparedStatement*NA*NA*NA*NA*NA****NA*NA*NA*NA*NA*NA*NA*NA*Database query took more than the threshold of 500 ms: 1,047 ms SQL: select pzPVStream from rules.pr4_base where pxObjClass = ?*
You can see both local time and GMT, because ALERT log message string contains GMT time. If it's the only way to configure date, we cannot change the date IN message string. Am I correct?
It is possible to have the date written in the timezone of our choice, and only have the date appears once per log message. Assuming Pega Platform 7.3 or higher, you need to change the relevant Pattern or PatternLayout elements in the Log4j configuration file prlog4j2.xml. This file is bundled within the Pega Platform WAR and EAR files. You can see a sample of this file in the following article in the Pega Community: https://community.pega.com/knowledgebase/articles/pega-platform-logging-log4j-2-logging-service.
For example, one of the PatternLayout within the prlog4j2.xml file (in my Pega Platform 8.1 instance) looks like this:
Remark: Pega Platform displays the date and time using the default format for the system, and it is what I specify in the PatternLayout above. More to the point, if you do not specify the date and time format, the timezone setting is ignored. There are many date and time formats supported and you can read more about them in the Log4j documentation here: https://logging.apache.org/log4j/2.x/manual/layouts.html#PatternLayout. Look for the section Patterns and the table that list the Conversion Pattern.
The above link is about analyzing log (with PLA or AES/PDC), not to modify the log message (time is output in message itself) of ALERT, ALERTSECURITY and SecurityEvent log. Modifying prlog4j2.xml appends date time, but that doesn't mean change time format in the message (as I commented above.) It doesn't work as I wanted to do.