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

Use Slog logger #65

Open
mehdihadeli opened this issue Apr 11, 2023 · 11 comments
Open

Use Slog logger #65

mehdihadeli opened this issue Apr 11, 2023 · 11 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed logging

Comments

@mehdihadeli mehdihadeli self-assigned this Apr 11, 2023
@mehdihadeli mehdihadeli added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Aug 30, 2023
@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

I wanna try this one too, but I'm not sure if I am running this project correctly~~,
just run cmd/app/main.go from catalog_read_service, write_service and order_service?

@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

And I notice we will intergate ELK to this project, so we might wanna Use Slog before we introduce ELK right? and by the way, intergate ELK need someone fully understand this project right? about how fx are working here and event driven , message queue all that stuff~~~

@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

And I notice we will intergate ELK to this project, so we might wanna Use Slog before we introduce ELK right? and by the way, intergate ELK need someone fully understand this project right? about how fx are working here and event driven , message queue all that stuff~~~

try to run this project with this method and I got something like this
image

but , when I make unit-test locally all tests passed. that means the docker enviroment was nothing wrong right?

@mehdihadeli
Copy link
Owner Author

Yes, slog is built structured logging in go 21.0, so it is better we switch to this library. Maybe we have to upgrade the project to go 21.0 at first. Maybe in a separated issue or pull request.
Yes, first we should use slog after that we integrate that with ELK and kibana

@mehdihadeli
Copy link
Owner Author

mehdihadeli commented Aug 31, 2023

And I notice we will intergate ELK to this project, so we might wanna Use Slog before we introduce ELK right? and by the way, intergate ELK need someone fully understand this project right? about how fx are working here and event driven , message queue all that stuff~~~

try to run this project with this method and I got something like this image

but , when I make unit-test locally all tests passed. that means the docker enviroment was nothing wrong right?

This is a temp docker container that use by go-testcotainer library for my integration and end-to-end tests, it should be ephemeral and after running tests it should be destroyed. 65027:27017 is a testcontainer for MongoDB.
Yes, it is fine, no problem. Just some logging to destroy containers, I think so. Maybe after destroy container by testcontainer we lost the connection for mongo, and we get this error

@mehdihadeli
Copy link
Owner Author

Could you first upgrade to version 21 at first #81 ?

@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

ok, so I will look up all this parpers you mentioned on the top , and come up with a plan about how to use slog, but at some point , I'm gonna need to run this project correctly to see the log right ? is there any doc on how should I run this project?

@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

Could you first upgrade to version 21 at first #81 ?

sure

@mehdihadeli
Copy link
Owner Author

Thanks

@mehdihadeli
Copy link
Owner Author

mehdihadeli commented Aug 31, 2023

For migrating to slog, you can create an abstraction like my zap abstraction. at the end all of this abstraction like zap, logrus, ... will implement logger interface and we use logger interface totally in the app

@Alan-MQ
Copy link
Contributor

Alan-MQ commented Aug 31, 2023

ok, I will check it out first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed logging
Projects
None yet
Development

No branches or pull requests

2 participants