If you know the message ID of the message you are trying to find in History log, you can use the DSPLOG command...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
with MSGID and you will only see Messages with that message ID. For example: DSPLOG MSGID(CPF0000) will display only messages starting with CPF as their message IDs.
Writing to History log:
Use the following command to write to the History log:
SNDMSG MSG('Message text') TOMSGQ(*HSTLOG)