DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Wiles, Keith" <keith.wiles@intel.com>
Cc: DPDK <dev@dpdk.org>
Subject: Re: [dpdk-dev] Logging format and time stamping
Date: Tue, 19 Dec 2017 08:01:29 -0800	[thread overview]
Message-ID: <20171219080129.0af9ab42@xeon-e3> (raw)
In-Reply-To: <98763630-51EB-440B-934C-8489563F3AA2@intel.com>

On Tue, 19 Dec 2017 15:51:09 +0000
"Wiles, Keith" <keith.wiles@intel.com> wrote:

> > On Dec 19, 2017, at 9:44 AM, Stephen Hemminger <stephen@networkplumber.org> wrote:
> > 
> > On Tue, 19 Dec 2017 14:12:27 +0000
> > "Wiles, Keith" <keith.wiles@intel.com> wrote:
> >   
> >> Hi all,
> >> 
> >> One other area with logging is we do not time stamp our logs to the screen, which I feel is needed in some cases. The bigger area is figuring out where the log message came from and greping the code is a bit hard in some cases.
> >> 
> >> I would like to see more information in the log output with file and line number of the log message with the time stamp. e.g.
> >> 
> >> [timestamp] pid function_name(filename:line) logid: log message
> >> 
> >> 
> >> [ timestamp ] pid   Function/file/line number           Lid: Log message 
> >> [  14.039999] 49203 pkt_data_to_mbuf(pkt_mbufs.h:85)    FNET: Failed append to mbuf too much data.
> >> 
> >> - The time stamp is from gettimeofday seconds.usecs formatted. Using a relative time from application start.
> >> - The pid is the process ID or logical core id in fixed %5d or some fixed width.
> >> - Function/file/line number __func__(basename(__FILE__):__LINE__) using a fixed width like %30s does not work in all cases but most.
> >> - The lid is the LOG ID used(PMD, EAL, …) and then the original log message.
> >> 
> >> The timestamp helps determine when the message was created, but could be turned off for normal use. The pid would be nice to know which thread or lcore created the message. The bigger one is the function/file/line is the one a would like to see most. Making some of the fields fixed length helps align the messages.
> >> 
> >> What are your thoughts here?
> >> 
> >> Regards,
> >> Keith
> >>   
> > 
> > Syslog is where most real applications send their logging, and it already does
> > timestamping.  
> 
> Yes, I agree I forgot to add it was optional. The log messages currently go the screen for me and I still need to see the timestamp instead of looking in a log file.
> 
> Regards,
> Keith
> 

Applications are also free to implement their own log output handler.
Why not do that if you need something special.

  reply	other threads:[~2017-12-19 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19 14:12 Wiles, Keith
2017-12-19 15:44 ` Stephen Hemminger
2017-12-19 15:51   ` Wiles, Keith
2017-12-19 16:01     ` Stephen Hemminger [this message]
2017-12-19 16:20       ` Wiles, Keith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171219080129.0af9ab42@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=keith.wiles@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).