How to record Xid errors in a file

Hi,
I want to record xid errors caused by GPU to a separate file. I have found the the presence of xid erros in var-log folder with kern.log and kern.log.1 files. How to record these errors ?

Thank you.

You can have a script to cat the kernel.log.* and write it to file.