Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
9bbbeca3
Commit
9bbbeca3
authored
Jul 21, 2004
by
bugreport%peshkin.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 165589 Add data/errorlog logging support to bugzilla
r=jouni a=myk
parent
018ed17c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
Error.pm
Bugzilla/Error.pm
+31
-0
No files found.
Bugzilla/Error.pm
View file @
9bbbeca3
...
@@ -28,6 +28,7 @@ use base qw(Exporter);
...
@@ -28,6 +28,7 @@ use base qw(Exporter);
use
Bugzilla::
Config
;
use
Bugzilla::
Config
;
use
Bugzilla::
Util
;
use
Bugzilla::
Util
;
use
Date::
Format
;
sub
_throw_error
{
sub
_throw_error
{
my
(
$name
,
$error
,
$vars
,
$unlock_tables
)
=
@_
;
my
(
$name
,
$error
,
$vars
,
$unlock_tables
)
=
@_
;
...
@@ -38,6 +39,36 @@ sub _throw_error {
...
@@ -38,6 +39,36 @@ sub _throw_error {
Bugzilla
->
dbh
->
do
(
"UNLOCK TABLES"
)
if
$unlock_tables
;
Bugzilla
->
dbh
->
do
(
"UNLOCK TABLES"
)
if
$unlock_tables
;
# If a writable data/errorlog exists, log error details there.
if
(
-
w
"data/errorlog"
)
{
require
Data::
Dumper
;
my
$mesg
=
""
;
for
(
1
..
75
)
{
$mesg
.=
"-"
;
};
$mesg
.=
"\n[$$] "
.
time2str
(
"%D %H:%M:%S "
,
time
());
$mesg
.=
"$name $error "
;
$mesg
.=
"$ENV{REMOTE_ADDR} "
if
$ENV
{
REMOTE_ADDR
};
$mesg
.=
Bugzilla
->
user
->
login
if
Bugzilla
->
user
;
$mesg
.=
"\n"
;
my
%
params
=
Bugzilla
->
cgi
->
Vars
;
$
Data::Dumper::
Useqq
=
1
;
for
my
$param
(
sort
keys
%
params
)
{
my
$val
=
$params
{
$param
};
# obscure passwords
$val
=
"*****"
if
$param
=~
/password/i
;
# limit line length
$val
=~
s/^(.{512}).*$/$1\[CHOP\]/
;
$mesg
.=
"[$$] "
.
Data::
Dumper
->
Dump
([
$val
],[
"param($param)"
]);
}
for
my
$var
(
sort
keys
%
ENV
)
{
my
$val
=
$ENV
{
$var
};
$val
=
"*****"
if
$val
=~
/password|http_pass/i
;
$mesg
.=
"[$$] "
.
Data::
Dumper
->
Dump
([
$val
],[
"env($var)"
]);
}
open
(
ERRORLOGFID
,
">>data/errorlog"
);
print
ERRORLOGFID
"$mesg\n"
;
close
ERRORLOGFID
;
}
print
Bugzilla
->
cgi
->
header
();
print
Bugzilla
->
cgi
->
header
();
my
$template
=
Bugzilla
->
template
;
my
$template
=
Bugzilla
->
template
;
...
...
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