Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
61ac6cf7
Commit
61ac6cf7
authored
Apr 11, 2002
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #341: minor fixes to logging code
parent
602b73b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
10 deletions
+48
-10
ZServer/FCGIServer.py
ZServer/FCGIServer.py
+24
-5
lib/python/ZServer/FCGIServer.py
lib/python/ZServer/FCGIServer.py
+24
-5
No files found.
ZServer/FCGIServer.py
View file @
61ac6cf7
...
...
@@ -437,6 +437,23 @@ class FCGIChannel(asynchat.async_chat):
DebugLogger
.
log
(
'E'
,
id
(
self
))
user_agent
=
self
.
get_header
(
'user-agent'
)
if
not
user_agent
:
user_agent
=
''
referer
=
self
.
get_header
(
'referer'
)
if
not
referer
:
referer
=
''
auth
=
self
.
get_header
(
'Authorization'
)
name
=
'Anonymous'
if
auth
is
not
None
:
if
string
.
lower
(
auth
[:
6
])
==
'basic '
:
try
:
decoded
=
base64
.
decodestring
(
auth
[
6
:])
except
base64
.
binascii
.
Error
:
decoded
=
''
t
=
string
.
split
(
decoded
,
':'
,
1
)
if
len
(
t
)
<
2
:
name
=
'Unknown (bad auth string)'
else
:
name
=
t
[
0
]
if
self
.
env
.
has_key
(
'PATH_INFO'
):
path
=
self
.
env
[
'PATH_INFO'
]
else
:
...
...
@@ -452,20 +469,22 @@ class FCGIChannel(asynchat.async_chat):
self
.
addr
[
1
],
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gm
time
(
time
.
time
())
time
.
local
time
(
time
.
time
())
)
+
tz_for_log
,
method
,
path
,
self
.
reply_code
,
bytes
method
,
path
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
else
:
self
.
server
.
logger
.
log
(
'127.0.0.1'
,
'127.0.0.1
'
,
'- - [%s] "%s %s" %d %d'
%
(
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gm
time
(
time
.
time
())
time
.
local
time
(
time
.
time
())
)
+
tz_for_log
,
method
,
path
,
self
.
reply_code
,
bytes
method
,
path
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
...
...
lib/python/ZServer/FCGIServer.py
View file @
61ac6cf7
...
...
@@ -437,6 +437,23 @@ class FCGIChannel(asynchat.async_chat):
DebugLogger
.
log
(
'E'
,
id
(
self
))
user_agent
=
self
.
get_header
(
'user-agent'
)
if
not
user_agent
:
user_agent
=
''
referer
=
self
.
get_header
(
'referer'
)
if
not
referer
:
referer
=
''
auth
=
self
.
get_header
(
'Authorization'
)
name
=
'Anonymous'
if
auth
is
not
None
:
if
string
.
lower
(
auth
[:
6
])
==
'basic '
:
try
:
decoded
=
base64
.
decodestring
(
auth
[
6
:])
except
base64
.
binascii
.
Error
:
decoded
=
''
t
=
string
.
split
(
decoded
,
':'
,
1
)
if
len
(
t
)
<
2
:
name
=
'Unknown (bad auth string)'
else
:
name
=
t
[
0
]
if
self
.
env
.
has_key
(
'PATH_INFO'
):
path
=
self
.
env
[
'PATH_INFO'
]
else
:
...
...
@@ -452,20 +469,22 @@ class FCGIChannel(asynchat.async_chat):
self
.
addr
[
1
],
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gm
time
(
time
.
time
())
time
.
local
time
(
time
.
time
())
)
+
tz_for_log
,
method
,
path
,
self
.
reply_code
,
bytes
method
,
path
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
else
:
self
.
server
.
logger
.
log
(
'127.0.0.1'
,
'127.0.0.1
'
,
'- - [%s] "%s %s" %d %d'
%
(
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gm
time
(
time
.
time
())
time
.
local
time
(
time
.
time
())
)
+
tz_for_log
,
method
,
path
,
self
.
reply_code
,
bytes
method
,
path
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
...
...
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