Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getParameterNameLoggerMaxFiles example
foreach
(
$this
->plugins
as
$plugin
)
{
$this
->
processPlugin
(
$container
,
$plugin
->
getContainerPrefix
(
)
)
;
}
}
protected
function
processPlugin
(
ContainerBuilder
$container
, string
$servicePrefix
)
: void
{
if
(
!
$container
->
hasParameter
(
$logLevel
=
$this
->
getParameterNameLogLevel
(
$servicePrefix
)
)
)
{
$container
->
setParameter
(
$logLevel
,
$container
->
getParameter
(
'shopware.logger.level'
)
)
;
}
if
(
!
$container
->
hasParameter
(
$logMaxFiles
=
$this
->
getParameterNameLoggerMaxFiles
(
$servicePrefix
)
)
)
{
$container
->
setParameter
(
$logMaxFiles
, 14
)
;
}
$container
->
setDefinition
(
$this
->
getServiceIdLoggerHandler
(
$servicePrefix
)
,
$this
->
createLoggerHandler
(
$servicePrefix
)
)
;
$container
->
setDefinition
(
$this
->
getServiceIdLoggerFormatter
(
$servicePrefix
)
,
$this
->
createLoggerFormatter
(
)
)
;
$container
->
setDefinition
(
$this
->
getServiceIdLogger
(
$servicePrefix
)
,
$this
->
createLogger
(
$servicePrefix
)
)
;
}
protected
function
createLoggerHandler
(
string
$servicePrefix
)
: Definition
{
return
(
new
Definition
(
RotatingFileHandler::
class
,
[