join
donate

NTP Logging and Debugging API Manual

Configuration

The NTP Logging Framework shall take most of its logging configuration by parsing the ntp.conf configuration file. All the lines in ntp.conf beginning with “logging” shall pertain to logging settings.

logging channel channel _ parameters severities minimum_allowed_severities tags allowed_tags

  • logging : all config lines related to logging shall begin with this
  • channel : Can be any of the following
    • SYSLOG
    • FILE
    • TERMINAL
  • channel parameters : They are specific parameters pertaining to particular channel
    • SYSLOG
      • FACILITY : Specify the facility of SYSLOG about which we are talking
    • FILE
      • PATH : Specify the path of the file
    • TERMINAL
      • stdout/stderr/some remote screen
  • severities : optional
    • minimum_allowed_severity : Specify the severity from which we want to log the messages to a particular channel.
    • For example, if we specify, logging FILE “/tmp/dummy” severities ERROR, then only messages with severity ERROR and above, like CRITICAL, ALERT, EMERGENCY are logged to “/tmp/dummy”
    • If severity clause is not specified then all severities are logged
  • tags : optional
    • allowed_tags : these are the tags that need be logged to the particular channel
    • The allowed tags should be a list enclosed within () , {} or []
    • If tags clause is not specified then all tags are logged
 

MACROS and ENUM defined and that can be used

Log Errors: LOG_ERR_OK, LOG_ERR_LEVEL, LOG_ERR_NULL, LOG_ERR_OPEN_FILE, LOG_ERR_NOT_FOUNF, LOG_ERR_NOT_IMPLEMENTED etc.

Log Levels: LOG_SILENT, LOG_BASIC, LOG_WARNING, LOG_INFO, LOG_FINE, LOG_FINEST

Output Types: STDOUT, STDERR, FILEOUT, RBUFOUT, SYSLOG

DESIGN

Logger is implemented as doubly linked list.

/*LOGGER TYPE*/

struct logger_s {

   /* identifier of the logger */

   uint16_t id;

   /* channel list */

   loggingChannel_t* chnlList;

   /* logger output type */

   logc_loggerType_t type;

   /* log level */

   logc_logLevel_t level;

   /* record type for error logging */

   logc_errRecordType_t errRecordType;

   /* record type for log logging */

   logc_logRecordType_t logRecordType;

   /* pointer to publisher function */

   publisher_t publisher;

   /* destination to write */

   void dest;

};

/*Implementation*/

struct loggerList_s {
  
   logger_t logger; 

   struct loggerList_s* next;

   struct loggerList_s* before;
};

Logger type has the capablity to define level and channel list( which have various tags). I think we can define logger for each level and sink the log to channel according to level for each logger call.

-- ShubhamSinghal - 2013-07-21


This topic: Dev > WebHome > GoogleSummerOfCode > GSoC2013LoggingDebugging > GSoC2013LoggingDebuggingDetailedImplementation
Topic revision: r5 - 2013-07-31 - 23:00:49 - HarlanStenn
 
SSL security by CAcert
Get the CAcert Root Certificate
This site is powered by the TWiki collaboration platform
IPv6 Ready
Copyright & 1999-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding the site? Send feedback