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

Make some const public #139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Make some const public #139

wants to merge 1 commit into from

Conversation

hedii
Copy link

@hedii hedii commented Dec 13, 2022

Hi,

I am the owner of hedii/laravel-gelf-logger, a wrapper for laravel logging based on your repo.

Happy to see the v2 becoming stable.

You made some constants on the HttpTransport class private, is there any reason for that?

I think it should be public, because they are the default values for graylog, and i was getting these values from your repo (https://github.com/hedii/laravel-gelf-logger/blob/4310f353c771742dd9eb8034280ac64c8d6608ee/src/GelfLoggerFactory.php#L67).

This pull request change these constants from private to public.

Thanks for your work.

@bzikarsky
Copy link
Owner

Hi hedii! I understand the issue and the requirement. If we provide default values "as a contract" for downstream libraries in gelf-php we could do it properly. How about we define either an uninstantiable class GraylogDefaults (abstract or private ctor) or an additional, namespaced file that carries all the Graylog2 default properties: host, port(s) for the different protocols, paths. This then becomes part of the library API and is not attached to a specific transport. I think it makes more sense, because there no 1:1 mapping between the defaults and transport implementations and also the concept of the transports is less universal than those defaults.

If we'd go with a class, we could even create static methods that spit out preconfigured transports and other objects for default Graylog2 use.

What do you think?

@hedii
Copy link
Author

hedii commented Dec 13, 2022

yes that would be great :)

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

Successfully merging this pull request may close these issues.

2 participants