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

stdout/stderr logging option #159

Merged
merged 5 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [4.3.19, 5.1.6, 5.2.4]
version: [4.3.19, 5.1.6, 5.2.5]
os: [debian, alpine, python2, python36, python37]
exclude:
- version: 4.3.19
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/alpine/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/alpine/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/debian/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/debian/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
2 changes: 1 addition & 1 deletion 5.2/5.2.5/python2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:2.7-slim-bullseye
FROM python:2.7-slim-buster

ENV PIP=20.3.4 \
ZC_BUILDOUT=2.13.4 \
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/python2/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/python2/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/python36/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/python36/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/python37/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/python37/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
4 changes: 4 additions & 0 deletions 5.2/5.2.5/python38/buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ zcml-additional =
max_age="3600"
/>
</configure>
event-log-handler = StreamHandler
event-log-args = (sys.stderr,)
access-log-handler = StreamHandler
access-log-args = (sys.stdout,)

# Requires gcc, thus install it on image build
[mrbob]
Expand Down
16 changes: 15 additions & 1 deletion 5.2/5.2.5/python38/docker-initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def buildout(self):
versions = self.env.get("PLONE_VERSIONS",
self.env.get("VERSIONS", "")).strip().split()

file_logging = self.env.get("FILE_LOGGING")

sources = self.env.get("SOURCES", "").strip()
sources = sources and [x.strip() for x in sources.split(",")]

Expand All @@ -242,7 +244,7 @@ def buildout(self):

enabled = bool(site)
if not (
eggs or zcml or relstorage or develop or enabled or extra_extends
eggs or zcml or relstorage or develop or enabled or extra_extends or file_logging
):
return

Expand All @@ -268,6 +270,10 @@ def buildout(self):
if relstorage:
buildout += RELSTORAGE_TEMPLATE.format(relstorage=relstorage)

# Add file logging configuration if needed
if file_logging:
buildout += FILE_LOGGING_INSTANCE

# Add sources configuration if needed
if sources:
buildout += SOURCES_TEMPLATE.format(sources="\n".join(sources))
Expand Down Expand Up @@ -354,6 +360,14 @@ def setup(self, **kwargs):
{sources}
"""

FILE_LOGGING_INSTANCE = """

[instance]
event-log-handler = FileHandler
event-log-args = ('${buildout:var-dir}/log/instance.log', 'a')
access-log-handler = FileHandler
access-log-args = ('${buildout:var-dir}/log/instance-access.log', 'a')
"""

def initialize():
""" Configure Plone instance as ZEO Client
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

- Default logging to stdout/stderr by default from 5.2.5. Setting env FILE_LOGGING to revert to previous behavior.
[@mamico]
- Allow buildout to extend custom files
[@pnicolli]
- Enable LDAP/AD support on Plone 5.1
Expand Down