-
Notifications
You must be signed in to change notification settings - Fork 45
Improve logging in RADIUS server and client #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| try | ||
| IP = get_ip(Addr), | ||
| ets:insert(?MODULE, {{IP, Port}, Retries, Retries}) | ||
| catch error:badarg -> | ||
| ?LOG(error, "Can't resolve hostname - ~p", [Addr]) | ||
| end; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that other places use the try around get_ip too, but that is just because get_ip/1 is not really the right fit for those.
It would IMHO be far better to change the return of get_ip/1 to {ok, IP}|{error, Error} and change the 3 places in this file that use it to handle that return properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but as get_ip is a part of public API I decided to not changeat least in this PR to not affect potential callers
RoadRunnr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved as is, although I would prefer if you could change the try around get_ip
This commit provides the following improvements for the logging: 1. Switch to info from debug in the logging messages for the incoming requests and outgoing responses. There is no big sense in these messages anyway if everything is normal but more useful during debugging process. 2. Add logging to the RADIUS client if hostname can not be resolved. The log messages are added only to the place where we handle secondary/failover RADIUS servers to not spam with such messages. 3. Remove additional log message for the outgoing response. We already have such message from the point 1 which has everything what the removed message had except the RADIUS server name.
This commit provides the following improvements for the logging: