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

AsyncGelfHttpAppender error in OnClose() method. #71

Open
FedericoBusso opened this issue Oct 24, 2019 · 2 comments
Open

AsyncGelfHttpAppender error in OnClose() method. #71

FedericoBusso opened this issue Oct 24, 2019 · 2 comments

Comments

@FedericoBusso
Copy link

When setting an invalid URL on the appender, the application crashes when trying to log with the following error:

https://i.imgur.com/b50Zegs.png

with the following appender config:

https://i.imgur.com/ApQL4Xu.png

Looking through the code, the OnClose of the appender has the _sender property set to null since the

base.ActivateOptions();

fails.

could probably fix this by just putting the _sender initialization before callind the base.ActivateOptions in the AsyncGelfHttpAppender's own ActivateOptions.

@jjchiw
Copy link
Owner

jjchiw commented Oct 24, 2019

Hi!

I think the exception is correct based on that the input (URL) is invalid....

Why the library should continue executing if it's not going to do what it's expected....

@FedericoBusso
Copy link
Author

Hi!

The exception is correct. I might've not been clear enough, my question would be:

On initial app load, the appender fails to be created which is what is expected. Then, it'd be expected that any logging calls just don't do anything but instead the OnClose() method of the appender is being called which causes said crash.

Why would the OnClose() method be called if it wasn't added to the root logger?

I'm sorry if I'm mistaken on something, just trying to figure this one out.

Thanks a bunch

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