question about logging levels, using syslog facility.
Good day! I'm using freeradius3.0.10. Here is my log configuration from radiusd.cong: log { destination = syslog syslog_facility = local1 stripped_names = no auth = yes auth_badpass = yes auth_goodpass = yes } Here is line from /etc/rsyslog.conf : local1.info -/var/log/radius/radius.log And I use my own perl module for auth-tion, where a lot of debug, info, error and so on information. 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; I've finished my test, so I want to turn off debug info, but it still exist in the /var/log/radius/radius.log file (&radiusd::radlog(L_DBG, "Auth: Calling-Station-Id: ".$RAD_REQUEST{'Calling-Station-Id'}); ). I've restarted rsyslog, radiusd daemon was started without any params. Why debugging information doesn't want to disappear? Any ideas? Log exampe with debug info Jan 12 15:25:36 radiusn-test1 radiusd[11284]: (27673) Login OK: [12345/<via Auth-Type = Perl>] (from client localhost port 0 cli 12345) Jan 12 15:25:36 radiusn-test1 radiusd[11284]: rlm_perl: Auth: Calling-Station-Id: 12345
On Jan 12, 2016, at 8:38 AM, Konstantin Chekushin via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Good day! I'm using freeradius3.0.10. Here is my log configuration from radiusd.cong: ... I've finished my test, so I want to turn off debug info, but it still exist in the /var/log/radius/radius.log file (&radiusd::radlog(L_DBG, "Auth: Calling-Station-Id: ".$RAD_REQUEST{'Calling-Station-Id'}); ).
You've configured the server to log the status of authentication requests. It's doing what you want. See the documentation in the "log" section for how it works. Alan DeKok.
You've configured the server to log the status of authentication requests. It's doing what you want.
That's true. And I want to keep it in the radius.log in the future. But! My own module add debug information anyway. If I will turn of auth info ("auth = no"), then I will lose only one record in my radius.log (that one: Jan 12 15:25:36 radiusn-test1 radiusd[11284]: (27673) Login OK: [12345/<via Auth-Type = Perl>] (from client localhost port 0 cli 12345) ), But all others (from rlm_perl) will be still there in the log... Цитирование Alan DeKok <aland@deployingradius.com> :
On Jan 12, 2016, at 8:38 AM, Konstantin Chekushin via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Good day! I'm using freeradius3.0.10. Here is my log configuration from radiusd.cong: ... I've finished my test, so I want to turn off debug info, but it still exist in the /var/log/radius/radius.log file (&radiusd::radlog(L_DBG, "Auth: Calling-Station-Id: ".$RAD_REQUEST{'Calling-Station-Id'}); ).
You've configured the server to log the status of authentication requests. It's doing what you want.
See the documentation in the "log" section for how it works.
Alan DeKok.
Hi, if you want a custom log file tha only contains things you want then either 1) use linelog module 2) write your own logfile from your PERL code alan
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... Цитирование A.L.M.Buxey@lboro.ac.uk:
Hi,
if you want a custom log file tha only contains things you want then either
1) use linelog module
2) write your own logfile from your PERL code
alan
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
On 12-01-16 17:54, Herwin Weststrate wrote:
I wouldn't call this politically, but the constants in example.pl are out of sync in multiple ways. From example.pl: ...
The v3.0.x branch just got fixed (commit 557c2650deb92adc82d78e75767783ae1b474dd0). Apply the same changes to your script and the debug levels will behave logically again. -- Herwin Weststrate
participants (4)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Herwin Weststrate -
koch@inbox.lv