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

Have Squid log to /dev/stdout to stream logs to Cloud Logging #980

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

kunzese
Copy link
Collaborator

@kunzese kunzese commented Nov 15, 2022

This PR uses dark Docker voodoo to make the Squid container able to log to /dev/stdout, which then get streamed to Cloud Logging via the COS logging agent.

FYI: @gaspar-chilingarov

Copy link
Collaborator

@ludoo ludoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost calls for docker compose :)

@kunzese
Copy link
Collaborator Author

kunzese commented Nov 15, 2022

almost calls for docker compose :)

Good idea - i will adjust this PR.

@kunzese kunzese marked this pull request as draft November 15, 2022 13:55
@ludoo
Copy link
Collaborator

ludoo commented Nov 15, 2022

almost calls for docker compose :)

Good idea - i will adjust this PR.

you probably need to download docker-compose, which will then fail if there's no public access. :) interested in what you come up with, but this PR is totally fine as is if you want to merge!

@kunzese kunzese changed the title Start additional container to tail squid's access logs for Cloud Logging Have Squid log to /dev/stdout to stream logs to Cloud Logging Nov 16, 2022
@kunzese kunzese marked this pull request as ready for review November 16, 2022 09:25
@gaspar-chilingarov
Copy link

gaspar-chilingarov commented Nov 16, 2022

i have a strange feeling about starting container with USER=${squid_user} and then using sudo to get more privileges. Why not to run as a root then?

Also I generally not sure why root permissions are necessary at all, because /dev/std* (link to /proc/self/fd/1) should be writable by the userID which runs the process. Have you checked that it does not work without sudo?

@gaspar-chilingarov
Copy link

LGTM :)

@kunzese kunzese merged commit df539b5 into master Nov 16, 2022
@kunzese kunzese deleted the kunzese/squid-tail-access-log branch November 16, 2022 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants