| Summary: | app-admin/mcelog enhancement: add date and time to logged exceptions | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Denilson Sá Maia <denilsonsa> |
| Component: | Current packages | Assignee: | No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | bkohler |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: | mcelog timestamp patch | ||
Could you please provide this change as handy patch file? Preferrably as unified diff (diff -u)... Created attachment 189406 [details, diff]
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.
Current stable has this patch, time to close the bug? This package is now maintainer-needed. If you want proxy-maintain it, poke the relative herd. (In reply to comment #3) > Current stable has this patch, time to close the 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.