-
Notifications
You must be signed in to change notification settings - Fork 24
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 Docker logging to stderr the default #1792
base: main
Are you sure you want to change the base?
Conversation
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.
Ziet er ok uit, maar lijkt me goed dat @quartje even er een blik op werpt. Ik zal iig voor onze deploy de handler terugzetten op syslog (zie OpenConext/OpenConext-deploy@443ea2f)
app/config/parameters.yml.dist
Outdated
@@ -110,6 +110,9 @@ parameters: | |||
## NOTICE: normal but significant condition | |||
## INFO: informational messages | |||
## DEBUG: debug messages | |||
## | |||
## handler can be 'docker' or 'syslog' | |||
logger.handler: docker |
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.
Lijkt me prima, zolang we in OpenConext-deploy de handler maar weer terugzetten op syslog (toch, @quartje ?)
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.
Overigens (vraag voor @quartje denk ik): klopt het dat we in de dockers syslog gebuiken dan?
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.
nee, daar wordt stdout gebruikt. Ik snap het probleem ook nog niet helemaal, want in de docker file wordt een logging.yml geplaatst:
https://github.com/OpenConext/OpenConext-engineblock/blob/main/docker/Dockerfile.prod#L16
Dat is deze:
https://github.com/OpenConext/OpenConext-engineblock/blob/main/docker/conf/logging.yml
Volgens mij was het probeem al opgelost dus
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.
In de regel gebeuren configuratie verschillen met Symfony alleen met een afwijkende parameters.yml
per omgeving. Ik had dus niet verwacht dat er nog een losse config overschreven zou worden (in dit geval de logging,yaml
).
De aanpassing had ik gedaan omdat er in dev modus in devconf geprobeerd om naar syslog te loggen, dat leek dus nog een pre devconf oplossing. Dat werkte in development niet lekker en ook de console commando's loggen in devconf dan te veel naar stderr.
Vandaar dat ik een aanpassing had gedaan om of naar 'syslog' of naar 'docker' (stderr) te loggen. De vraag is nu even hoe er in productie wordt gelogd en of syslog dan nog wordt gebruikt. Want is die aparte logging.yaml dan nog nodig en zou dit dan niet gelost kunnen worden met alleen een afwijking in de parameters.yaml
. Alleen als syslog dan nog nodig is tenminste.
Beter is het denk ik als ik die copy uit die prod dockerfile haal en de juiste config gewoon in de logging.yml
aanpas zodat dezelfde in dev en prod worden gebruikt. Dus dat zal dan de versie worden zonder syslog maar met het uistluiten van sommige channels. Want ik denk dat daar dan geen verschil meer in zouden moeten zitten, m.u.v. het log level.
Dit zullen Symfony developers ook eerder verwachten en dus ook testen, wat bugs in de toekomst ook zal voorkomen.
app/config/logging.yml
Outdated
path: "php://stderr" | ||
ident: "%logger.syslog.ident%" | ||
formatter: engineblock.logger.additional_info_formatter | ||
channels: ["!authentication","!console","!event", "!doctrine"] |
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.
Is er een reden om hier niet alle logging mee te nemen (zoals syslog ook doet)?
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.
Oh, ik zie nu pas wat er gebeurt; de authentication logs gaan al direct naar syslog. Zou je die ook niet via de docker handler willen laten lopen dan?
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.
Alles moet naar stdout zodat het opgepakt en doorgestuurd kan worden
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've left the default untouched, and I've included a seperate logging.yml in docker/conf/logging.yml which is copied to the container.
I assume you want the default also to work immediately when using a container. If that is the case this should work and not interfer with the prod container (as it is overwritten there)
Ahh, I was looking for that, but the |
…neblock#1792)" This reverts commit 443ea2f.
f9950ec
to
9d79c04
Compare
7ce7a13
to
19a6ca5
Compare
This will make logging to stderr the default. Also documentation is added on how to add syslog config. This will allow debugging in dev env (devonf) out-of-the-box.
19a6ca5
to
12dad36
Compare
Thanks @quartje. It seems that I can also use the production configuration in development because only the log level will be different. The log level is already configurable in I discussed this also IRL with @baszoetekouw and we decided to use the logging to stderr as default and drop the syslog support. I however did add documentation for users of Engineblock on howto log to syslog. |
This will make logging to stderr the default.
Also documentation is added on how to add syslog config.
This will allow debugging in dev env (devonf) out-of-the-box.