Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
Not eligible to see or edit group visibility for this bug.
View Bug Activity | Format For Printing | XML | Clone This Bug
Currently, the /etc/cron.daily/mcelog file logs new exceptions to /var/log/mcelog, but does not write any timestamp. This is not very useful, because we usually check logs long time after the error has occurred. Thus, I've made a very small 1-line enhacement that adds the timestamp to each log entry. At /etc/cron.daily/mcelog file, change this line: /usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog To this: /usr/sbin/mcelog --ignorenodev --filter | awk '{s=s $0 "\n"} END{ if(NR > 0){ printf("%s\n%s",strftime("%F %T %Z"),s) }}' >> /var/log/mcelog This little awk script (tested with gawk) will print the timestamp if, and only if, the output of mcelog command is not empty.
Could you please provide this change as handy patch file? Preferrably as unified diff (diff -u)...
Created an attachment (id=189406) [details] mcelog timestamp patch Here is the patch. Quite simple Would be nice to submit this patch to upstream. Could anyone please do that for me? By the way, I've just noticed that there is a mcelog-0.8_pre1-timestamp-mcelog.patch already in portage, but only for the currently masked package. It would be worthy to backport that patch to current stable version.