Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 267384
Alias:
Product:
Component:
Status: NEW
Resolution:
Assigned To: AMD64 Project <amd64@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Denilson <denilsonsa@gmail.com>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
mcelog.patch mcelog timestamp patch patch Denilson 2009-04-25 17:09 0000 330 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 267384 depends on: Show dependency tree
Bug 267384 blocks:
Votes: 1    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.








View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2009-04-24 22:59 0000
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.

------- Comment #1 From Lars Wendler (Polynomial-C) 2009-04-25 16:58:22 0000 -------
Could you please provide this change as handy patch file? Preferrably as
unified diff (diff -u)...

------- Comment #2 From Denilson 2009-04-25 17:09:44 0000 -------
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.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug