Skip to content
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

Error levels seem too high #5

Closed
BrianHicks opened this issue Jul 2, 2015 · 5 comments
Closed

Error levels seem too high #5

BrianHicks opened this issue Jul 2, 2015 · 5 comments

Comments

@BrianHicks
Copy link

I'm getting a lot of error messages in my logs for normal operations while using this library. For example, these three show up a lot:

erlzk/src/erlzk_conn.erl

Lines 273 to 287 in e6495a1

terminate(normal, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:warning_msg("Server is closed~n"),
ok;
terminate(shutdown, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:warning_msg("Server is shutdown~n"),
ok;
terminate(Reason, #state{socket=Socket}) ->
gen_tcp:send(Socket, <<1:32, -11:32>>),
gen_tcp:close(Socket),
error_logger:error_msg("Server is terminated: ~p~n", [Reason]),
ok.
It would be my understanding that those would not need to be logged at all, and if they did they would be merely informative since they're normal shutdown conditions.

There are other conditions that are logged as warnings as well, such as

error_logger:warning_msg("Create a new connection to ~p:~p successful~n", [Host, Port]),
- a successful connection! Why should that trigger a warning?

Would you welcome a PR to tone these down a little?

@megayu
Copy link
Contributor

megayu commented Jul 3, 2015

I don't think that's a problem, just logging about connection status.

If you see a lot of these logging, the connection to ZooKeeper maybe unstable or the erlzk_conn process was be shut down a lot, none of these situations are normal, that's why i use warning.

@BrianHicks
Copy link
Author

BrianHicks commented Jul 3, 2015 via email

@megayu
Copy link
Contributor

megayu commented Jul 3, 2015

That's a successful reconnection after the link was broken, logging level of normal connection is info.

@BrianHicks
Copy link
Author

BrianHicks commented Jul 3, 2015 via email

@megayu
Copy link
Contributor

megayu commented Jul 3, 2015

Looks like we are good here.

@megayu megayu closed this as completed Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants