I used to have this date format (lines 1 and 2) in log files created by rules in OH2.
After migrating the format changed as seen in line 3 and 4.
2022-11-19T11:31:28.034+10:00 MEGA_MODBUS_ERROR_Invalid CRC at 8059
2022-11-19T11:51:15.686+10:00 MEGA_MODBUS_ERROR_Invalid CRC at 8059
2022-11-19T13:18:48.865143+10:00[Australia/Brisbane] MEGA_MODBUS_ERROR_Invalid CRC at 8051
2022-11-19T13:39:07.000743+10:00[Australia/Brisbane] MEGA_MODBUS_ERROR_Response Timed Out at 8000
OH2: val startOfDay = now.withTimeAtStartOfDay
OH3: val START_OF_DAY = ZonedDateTime.now().with(LocalTime.MIDNIGHT)
Is there a format on OH3 that matches lines 1 and 2?
You’re talking about the timestamps on log entries, right?
All logging stuff is controlled by $OH_USERDATA/etc/log4j2.xml. But the default pattern layouts there shouldn’t be showing the timezone at all, in neither OH 2.5 nor OH 3. Also, those examples are missing a bunch of stuff that is normally there like the logging level and where the log statement came from.
So have you ever edited this file? Do the contents of this file differ from the official one?
Is this one of your “other” logs that you create using echo instead of the built in logging features?
Changing to LocalDateTime resulted in the 2nd line…
2022-12-13T18:25:33.244697+10:00[Australia/Brisbane] MEGA_MODBUS_ERROR_Invalid CRC at 8059
2022-12-13T19:17:12.899308 MEGA_MODBUS_ERROR_Invalid CRC at 8100