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

Apache LOGLEVEL or ACCESSLOG does not seem to have an effect #82

Closed
igoooor opened this issue Jul 27, 2022 · 12 comments
Closed

Apache LOGLEVEL or ACCESSLOG does not seem to have an effect #82

igoooor opened this issue Jul 27, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@igoooor
Copy link

igoooor commented Jul 27, 2022

Hello there,

I set my LOGLEVEL to error but I still see access logs in the container stdout. Did I misunderstood the purpose of LOGLEVEL? If so, is there a way to disable apache access logs?

Thanks!

@fzipi
Copy link
Member

fzipi commented Jul 27, 2022

To disable apache access logs, you can set ACCESSLOG=/dev/null I guess. See https://github.com/coreruleset/modsecurity-docker#apache-env-variables from the base container. The crs container is sending the errorlog to stderr

@fzipi fzipi added the documentation Improvements or additions to documentation label Jul 27, 2022
@igoooor
Copy link
Author

igoooor commented Jul 27, 2022

Good hint indeed, but weirdly enough I could not make that work. I'm checking this path a bit more

@igoooor igoooor changed the title Apache LOGLEVEL does not seem to have an effect Apache LOGLEVEL or ACCESSLOG does not seem to have an effect Jul 29, 2022
@igoooor
Copy link
Author

igoooor commented Jul 29, 2022

So far I was not able to stop accesslogs from showing up. Anyone managed to do so?

@fzipi
Copy link
Member

fzipi commented Jul 30, 2022

Ok, I think it was hiding in plain sight, but enough to be ignored. Short answer: you can't do it right now. This is because, while the base container will use the ACCESSLOG you provide, it also uses the directive TransferLog, and sends it unconditionally to stdout :/

I'm creating an issue in the base container to track this. Thanks for the report!

@fzipi fzipi added bug Something isn't working and removed documentation Improvements or additions to documentation labels Jul 30, 2022
@igoooor
Copy link
Author

igoooor commented Jul 30, 2022

Thank you for your support!

@fzipi
Copy link
Member

fzipi commented Jul 30, 2022

Even after doing this:

      ACCESSLOG: "/dev/null"
      ERRORLOG: "/dev/null"
      METRICSLOG: "/dev/null"
      PERFLOG: "/dev/null combined"

I'm still getting access logs 😠 ! So I think this comes from the upstream httpd container. 😄

@fzipi
Copy link
Member

fzipi commented Jul 30, 2022

And here is the place: https://github.com/docker-library/httpd/blob/f3b7fd9c8ef59d1ad46c8b2a27df3e02d822834f/2.4/Dockerfile#L205-L212.

We will need to do a similar change.

@igoooor
Copy link
Author

igoooor commented Aug 2, 2022

I see the PR on the base container image is merged, so I guess it will soon make its way to the docker image?

@theseion
Copy link
Contributor

It should... @fzipi?

@fzipi
Copy link
Member

fzipi commented Aug 15, 2022

We have a weekly build, so it should be there already 🤔.

Can you try it?

@fzipi
Copy link
Member

fzipi commented Aug 22, 2022

@igoooor Were you able to test this? Is it working now?

@igoooor
Copy link
Author

igoooor commented Aug 29, 2022

sorry for my late reply I was away.
Yes it seems to be working now with the latest docker build :)

@igoooor igoooor closed this as completed Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants