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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
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
!1786
parents
d496e223
c60d39e9
Changes
1
Show 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
six
import
argparse
import
argparse
import
atexit
from
io
import
BytesIO
from
io
import
BytesIO
import
logging
import
logging
import
os
import
os
...
@@ -176,6 +177,7 @@ def runwsgi():
...
@@ -176,6 +177,7 @@ def runwsgi():
parser
.
add_argument
(
'zope_conf'
,
help
=
'path to zope.conf'
)
parser
.
add_argument
(
'zope_conf'
,
help
=
'path to zope.conf'
)
parser
.
add_argument
(
'--timerserver-interval'
,
help
=
'Interval for timerserver'
,
type
=
float
)
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
(
'--threads'
,
help
=
'Number of threads'
,
default
=
4
,
type
=
int
)
parser
.
add_argument
(
'--pidfile'
,
help
=
'Write process id in file'
)
parser
.
add_argument
(
parser
.
add_argument
(
'--large-file-threshold'
,
'--large-file-threshold'
,
help
=
'Requests bigger than this size in bytes get saved into a temporary file '
help
=
'Requests bigger than this size in bytes get saved into a temporary file '
...
@@ -184,13 +186,6 @@ def runwsgi():
...
@@ -184,13 +186,6 @@ def runwsgi():
default
=
type_registry
.
get
(
'byte-size'
)(
"10MB"
))
default
=
type_registry
.
get
(
'byte-size'
)(
"10MB"
))
args
=
parser
.
parse_args
()
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
# Configure logging previously handled by ZConfig/ZServer
logging
.
captureWarnings
(
True
)
logging
.
captureWarnings
(
True
)
root_logger
=
logging
.
getLogger
()
root_logger
=
logging
.
getLogger
()
...
@@ -221,6 +216,18 @@ def runwsgi():
...
@@ -221,6 +216,18 @@ def runwsgi():
LongRequestLogger_dumper
.
logger
.
propagate
=
False
LongRequestLogger_dumper
.
logger
.
propagate
=
False
LongRequestLogger_dumper
.
logger
.
addHandler
(
long_request_log_handler
)
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
:
if
conf
.
debug_mode
:
console_handler
=
logging
.
StreamHandler
(
sys
.
stderr
)
console_handler
=
logging
.
StreamHandler
(
sys
.
stderr
)
console_handler
.
setFormatter
(
logging
.
Formatter
(
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