Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
a0b89f5d
Commit
a0b89f5d
authored
May 18, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Fix neo log rotation
See merge request
nexedi/erp5!1786
parents
d496e223
c60d39e9
Pipeline
#28172
failed with stage
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
product/ERP5/bin/zopewsgi.py
product/ERP5/bin/zopewsgi.py
+14
-7
No files found.
product/ERP5/bin/zopewsgi.py
View file @
a0b89f5d
import
six
import
argparse
import
atexit
from
io
import
BytesIO
import
logging
import
os
...
...
@@ -176,6 +177,7 @@ def runwsgi():
parser
.
add_argument
(
'zope_conf'
,
help
=
'path to zope.conf'
)
parser
.
add_argument
(
'--timerserver-interval'
,
help
=
'Interval for timerserver'
,
type
=
float
)
parser
.
add_argument
(
'--threads'
,
help
=
'Number of threads'
,
default
=
4
,
type
=
int
)
parser
.
add_argument
(
'--pidfile'
,
help
=
'Write process id in file'
)
parser
.
add_argument
(
'--large-file-threshold'
,
help
=
'Requests bigger than this size in bytes get saved into a temporary file '
...
...
@@ -184,13 +186,6 @@ def runwsgi():
default
=
type_registry
.
get
(
'byte-size'
)(
"10MB"
))
args
=
parser
.
parse_args
()
startup
=
os
.
path
.
dirname
(
Zope2
.
Startup
.
__file__
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
startup
,
'wsgischema.xml'
)):
schema
=
ZConfig
.
loadSchema
(
os
.
path
.
join
(
startup
,
'wsgischema.xml'
))
else
:
# BBB Zope2
schema
=
ZConfig
.
loadSchema
(
os
.
path
.
join
(
startup
,
'zopeschema.xml'
))
conf
,
_
=
ZConfig
.
loadConfig
(
schema
,
args
.
zope_conf
)
# Configure logging previously handled by ZConfig/ZServer
logging
.
captureWarnings
(
True
)
root_logger
=
logging
.
getLogger
()
...
...
@@ -221,6 +216,18 @@ def runwsgi():
LongRequestLogger_dumper
.
logger
.
propagate
=
False
LongRequestLogger_dumper
.
logger
.
addHandler
(
long_request_log_handler
)
if
args
.
pidfile
:
with
open
(
args
.
pidfile
,
'w'
)
as
f
:
f
.
write
(
'%s
\
n
'
%
os
.
getpid
())
atexit
.
register
(
os
.
unlink
,
args
.
pidfile
)
startup
=
os
.
path
.
dirname
(
Zope2
.
Startup
.
__file__
)
if
os
.
path
.
isfile
(
os
.
path
.
join
(
startup
,
'wsgischema.xml'
)):
schema
=
ZConfig
.
loadSchema
(
os
.
path
.
join
(
startup
,
'wsgischema.xml'
))
else
:
# BBB Zope2
schema
=
ZConfig
.
loadSchema
(
os
.
path
.
join
(
startup
,
'zopeschema.xml'
))
conf
,
_
=
ZConfig
.
loadConfig
(
schema
,
args
.
zope_conf
)
if
conf
.
debug_mode
:
console_handler
=
logging
.
StreamHandler
(
sys
.
stderr
)
console_handler
.
setFormatter
(
logging
.
Formatter
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment