question about logging levels, using syslog facility.

Herwin Weststrate herwin at quarantainenet.nl
Tue Jan 12 17:54:06 CET 2016


On 12-01-16 17:38, Konstantin Chekushin via Freeradius-Users wrote:
> I will use only &radiusd::radlog(L_INFO, ""); with text "Error: ", "Info: ", "Debug: " in the text... And with configurable variable debug_level in the program. if (debug_level == 3) - print everything, if == 2, err and info, if ==1, then only err.  
> 
> I just wonder, what is the point of all of this
> &radiusd::radlog(L_DBG, "");
> &radiusd::radlog(L_AUTH, "");
> &radiusd::radlog(L_INFO, "");
> &radiusd::radlog(L_ERR, "");
> &radiusd::radlog(L_PROXY, "");
> &radiusd::radlog(L_ACCT, "");
> 
> ?
> 
> It doesn't work, when log configured as syslog. If destination configured as "files", then log looks like:
> 
> Tue Jan 12 17:42:22 2016 : rlm_perl: authenticate - L_DBG 
> Tue Jan 12 17:42:22 2016 : Auth: rlm_perl: authenticate - L_AUTH
> Tue Jan 12 17:42:22 2016 : Info: rlm_perl: authenticate - L_INFO
> Tue Jan 12 17:42:22 2016 : Error: rlm_perl: authenticate - L_ERR
> Tue Jan 12 17:42:22 2016 : Warning: rlm_perl: authenticate - L_PROXY (???)
> Tue Jan 12 17:42:22 2016 : Proxy: rlm_perl: authenticate - L_ACCT (???)
> 
> It seems, that something politically incorrect here...

I wouldn't call this politically, but the constants in example.pl are
out of sync in multiple ways. From example.pl:

  # Same as src/include/radiusd.h
  use constant  L_DBG=>   1;
  use constant  L_AUTH=>  2;
  use constant  L_INFO=>  3;
  use constant  L_ERR=>   4;
  use constant  L_PROXY=> 5;
  use constant  L_ACCT=>  6;

The cannot be found in the given file, but the are available in
src/include/log.h:

  typedef enum log_type {
    L_AUTH = 2,   //!< Authentication message.
    L_INFO = 3,   //!< Informational message.
    L_ERR = 4,    //!< Error message.
    L_WARN = 5,   //!< Warning.
    L_PROXY = 6,    //!< Proxy messages
    L_ACCT = 7,   //!< Accounting messages

    L_DBG = 16,   //!< Only displayed when debugging is enabled.
    L_DBG_WARN = 17,  //!< Warning only displayed when debugging is
      enabled.
    L_DBG_ERR = 18,   //!< Error only displayed when debugging is
      enabled.
    L_DBG_WARN_REQ = 19,  //!< Less severe warning only displayed when
      debugging is enabled.
    L_DBG_ERR_REQ = 20  //!< Less severe error only displayed when
      debugging is enabled.
  } log_type_t;

-- 
Herwin Weststrate


More information about the Freeradius-Users mailing list