Bug #46053

Booting->initializeSystemLogger() uses a fixed $loggerObjectName, rather than fetch it from Settings.yaml

Added by Thiago Colares over 2 years ago. Updated over 2 years ago.

Status:Resolved Start date:2013-03-05
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

0%

Category:Log
Target version:-
PHP Version:5.3 Complexity:easy
Has patch:No Affected Flow version:Flow 2.0.0 beta 1

Description

It should be set by Settings.yaml instead. So...

File: \TYPO3\Flow\Core\Booting

/**
 * Initializes the System Logger
 *
 * @param \TYPO3\Flow\Core\Bootstrap $bootstrap
 * @return void
 */
static public function initializeSystemLogger(Bootstrap $bootstrap) {
    ...
    $systemLogger = \TYPO3\Flow\Log\LoggerFactory::create('SystemLogger', 'TYPO3\Flow\Log\Logger', $settings['log']['systemLogger']['backend'], $settings['log']['systemLogger']['backendOptions']);
    ...
}

Should something like

/**
 * Initializes the System Logger
 *
 * @param \TYPO3\Flow\Core\Bootstrap $bootstrap
 * @return void
 */
static public function initializeSystemLogger(Bootstrap $bootstrap) {
    ...
    $systemLogger = \TYPO3\Flow\Log\LoggerFactory::create('SystemLogger', $settings['log']['logger']['backend'], $settings['log']['systemLogger']['backend'], $settings['log']['systemLogger']['backendOptions']);
    ...
}

Note: I'm using $settings['log']['logger'] rather than 'TYPO3\Flow\Log\Logger'. Consequently, the Settings.yaml should be updated:

TYPO3:
  Flow:
    log:
      ...
      systemLogger:
        ...
        logger: 'TYPO3\Flow\Log\Logger'

46053 - a patch (untested) (2.4 kB) Thiago Colares, 2013-03-06 01:28


Related issues

related to TYPO3.Flow - Task #47346: Configuration schema for doctrine cacheImplementation sti... Resolved 2013-04-18
duplicates TYPO3.Flow - Bug #40738: Move System logger className to Settings instead of Objec... Resolved 2012-09-07

Associated revisions

Revision 0c1046e9
Added by Henrik Møller Rasmussen over 2 years ago

[FEATURE] Make System Logger frontend configurable

Move hard coded TYPO3\FLOW3\Log\Logger to Settings.yaml instead. This
allows a user to fully replace the logger instead of just adding or
removing backends.

Resolves: #40738 #46053
Releases: master, 2.0
Change-Id: I6da4763fb94798b1d1647b6108457996a48aa128

Revision b1c23134
Added by Henrik Møller Rasmussen over 2 years ago

[FEATURE] Make System Logger frontend configurable

Move hard coded TYPO3\FLOW3\Log\Logger to Settings.yaml instead. This
allows a user to fully replace the logger instead of just adding or
removing backends.

Resolves: #40738
Resolves: #46053
Releases: master, 2.0
Change-Id: I6da4763fb94798b1d1647b6108457996a48aa128

Revision 8ece7498
Added by Karsten Dambekalns over 2 years ago

[BUGFIX] Undefined index breaks logger setup in Production

With I6da4763fb94798b1d1647b6108457996a48aa128 the logger used for the
system log was made configurable. In Production context, when cached
settings are used, this breaks after an update - and even --force with a
cache flush does not help.

This change adds a safeguard against the settings not being there.

Change-Id: I3d72e8c8580f552f45a1865bd45dae01c4413cce
Related: #40738
Related: #46053
Releases: master, 2.0

Revision c3f0cdbf
Added by Karsten Dambekalns over 2 years ago

[BUGFIX] Undefined index breaks logger setup in Production

With I6da4763fb94798b1d1647b6108457996a48aa128 the logger used for the
system log was made configurable. In Production context, when cached
settings are used, this breaks after an update - and even --force with a
cache flush does not help.

This change adds a safeguard against the settings not being there.

Change-Id: I3d72e8c8580f552f45a1865bd45dae01c4413cce
Related: #40738
Related: #46053
Releases: master, 2.0

Revision 29ea4e4d
Added by Henrik Møller Rasmussen over 2 years ago

[FEATURE] Make System Logger frontend configurable

Move hard coded TYPO3\FLOW3\Log\Logger to Settings.yaml instead. This
allows a user to fully replace the logger instead of just adding or
removing backends.

Resolves: #40738 #46053
Releases: master, 2.0
Change-Id: I6da4763fb94798b1d1647b6108457996a48aa128

Revision 60e1bd57
Added by Karsten Dambekalns over 2 years ago

[BUGFIX] Undefined index breaks logger setup in Production

With I6da4763fb94798b1d1647b6108457996a48aa128 the logger used for the
system log was made configurable. In Production context, when cached
settings are used, this breaks after an update - and even --force with a
cache flush does not help.

This change adds a safeguard against the settings not being there.

Change-Id: I3d72e8c8580f552f45a1865bd45dae01c4413cce
Related: #40738
Related: #46053
Releases: master, 2.0

History

#1 Updated by Thiago Colares over 2 years ago

#2 Updated by Karsten Dambekalns over 2 years ago

  • Category set to Log

#3 Updated by Karsten Dambekalns over 2 years ago

  • Status changed from New to Closed
  • Assigned To set to Karsten Dambekalns

See #40738 for progress.

#4 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Closed to Under Review

Patch set 2 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19084

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 3 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19084

#6 Updated by Henrik Møller Rasmussen over 2 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF