Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892649
PhabricatorAccessLog.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1015 B
Referenced Files
None
Subscribers
None
PhabricatorAccessLog.php
View Options
<?php
final
class
PhabricatorAccessLog
{
static
$log
;
public
static
function
init
(
)
{
// NOTE: This currently has no effect, but some day we may reuse PHP
// interpreters to run multiple requests. If we do, it has the effect of
// throwing away the old log.
self
::
$log
=
null
;
}
public
static
function
getLog
(
)
{
if
(
!
self
::
$log
)
{
$path
=
PhabricatorEnv
::
getEnvConfig
(
'log.access.path'
)
;
$format
=
PhabricatorEnv
::
getEnvConfig
(
'log.access.format'
)
;
$format
=
nonempty
(
$format
,
"[%D]\t%p\t%h\t%r\t%u\t%C\t%m\t%U\t%R\t%c\t%T"
)
;
// NOTE: Path may be null. We still create the log, it just won't write
// anywhere.
$log
=
id
(
new
PhutilDeferredLog
(
$path
,
$format
)
)
->
setFailQuietly
(
true
)
->
setData
(
array
(
'D'
=>
date
(
'r'
)
,
'h'
=>
php_uname
(
'n'
)
,
'p'
=>
getmypid
(
)
,
'e'
=>
time
(
)
,
)
)
;
self
::
$log
=
$log
;
}
return
self
::
$log
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 17:09 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126805
Default Alt Text
PhabricatorAccessLog.php (1015 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment