Skip to content

Commit 6267965

Browse files
committed
Clean up grammar, enhance code-blocks.
1 parent 2f9af26 commit 6267965

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

docs/install/containers/recipes/index.md

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ myst:
33
html_meta:
44
"description": "Plone 6 Docker image recipes"
55
"property=og:description": "Plone 6 Docker image recipes"
6-
"property=og:title": "Plone 6 Image recipes"
7-
"keywords": "Plone 6, install, installation, docker, containers, Official Images"
6+
"property=og:title": "Plone 6 image recipes"
7+
"keywords": "Plone 6, install, installation, Docker, containers, official images"
88
---
99

10-
# Recipes
10+
# Docker recipes
1111

12-
Here you have some useful recipes when working with Plone containers
12+
This chapter offers some useful recipes when working with Plone containers.
1313

1414

15-
## Remove access log from plone containers
15+
## Remove access log from Plone containers
1616

17-
When working a project generated using [cookieplone](https://github.com/plone/cookieplone) you will be creating Plone containers for your project that are based on the official `plone/plone-backend` images.
17+
When you generate a project using [Cookieplone](https://github.com/plone/cookieplone), it creates Plone containers for your project that are based on the official [`plone/plone-backend`](https://github.com/plone/plone-backend) images.
1818

19-
You may have noted that when you run your container or the official `plone/plone-backend` image, the output mixes both the event log and the access log making it hard to follow the logs you may have added to your application.
19+
When you run your container or the official `plone/plone-backend` image with logging, the output mixes both the event log and the access log, making it hard to follow the logs you may have added to your application.
20+
In such cases, you may have a Docker Compose setup with several components including a proxy server that already provides access logs.
21+
Instead of duplicating the logging output, it is common to remove the access logging from the Plone container.
2022

21-
In such cases, you may end with a `docker compose` setup with several components in which you will have a proxy server that already provides access logs.
23+
To do so, create a custom {file}`zope.ini` file in your project's {file}`backend` folder with the following content.
2224

23-
So it is a common usage configuration to remove the access logging from the Plone container.
25+
```{code-block} ini
26+
:emphasize-lines: 17-20
2427
25-
To do so you will need a custom {file}`zope.ini` file in your project's {file}`backend` folder with the following content:
26-
27-
```ini
2828
[app:zope]
2929
use = egg:Zope#main
3030
zope_conf = %(here)s/%(config_file)s
@@ -37,7 +37,6 @@ threads = 2
3737
clear_untrusted_proxy_headers = false
3838
max_request_body_size = 1073741824
3939
40-
4140
[filter:translogger]
4241
use = egg:Paste#translogger
4342
setup_console_handler = False
@@ -96,33 +95,18 @@ class = StreamHandler
9695
args = (sys.stderr,)
9796
level = INFO
9897
formatter = generic
99-
10098
```
10199

102-
If you compare this file with the [original zope.ini file](https://github.com/plone/plone-backend/blob/6.1.x/skeleton/etc/zope.ini) that comes with the `plone/plone-backend` container, you may realize that the only change here is that we remove `translogger` from the `pipeline` option.
103-
104-
This `translogger` middleware [produces logs in the Apache Combined Log Format](https://docs.pylonsproject.org/projects/waitress/en/latest/logging.html) and that is exactly what we want to remove in our setup.
100+
Comparing this file with the [original `zope.ini` file](https://github.com/plone/plone-backend/blob/6.1.x/skeleton/etc/zope.ini) that comes with the `plone/plone-backend` container, you may realize that the only change is the `translogger` configuration was removed from the `pipeline` section.
101+
This [`translogger` middleware produces logs in the Apache Combined Log Format](https://docs.pylonsproject.org/projects/waitress/en/latest/logging.html).
102+
The above configuration removes it from the setup.
105103

106-
After adding the mentioned file in your project, you need to adjust the {file}`Dockerfile` also.
104+
After adding the {file}`zope.ini` file in your project, adjust the {file}`Dockerfile` by inserting the command `COPY zope.ini etc/` before the `RUN` command as highlighted below.
105+
This new command copies the {file}`zope.ini` file into the container.
107106

107+
```{code-block} dockerfile
108+
:emphasize-lines: 4
108109
109-
In your {file}`Dockerfile` you have the following contents:
110-
111-
```Dockerfile
112-
...
113-
# Add local code
114-
COPY scripts/ scripts/
115-
COPY . src
116-
117-
# Install local requirements and pre-compile mo files
118-
RUN <<EOT
119-
...
120-
```
121-
122-
Just before the `RUN` command, you need to copy the {file}`zope.ini` file into the container, as follows:
123-
124-
```Dockerfile
125-
...
126110
# Add local code
127111
COPY scripts/ scripts/
128112
COPY . src
@@ -132,5 +116,5 @@ COPY zope.ini etc/
132116
RUN <<EOT
133117
```
134118

135-
With these changes, after you build your project container as usual, it will not output the access log, but only the event log.
136-
119+
After making these changes, build the project container as usual.
120+
It will no longer output the access log, but will continue to output the event log.

0 commit comments

Comments
 (0)