2017 © Pedro Peláez
 

typo3-flow-package chromelogger

A TYPO3 Flow Logger Backend to send log the the Chrome Console

image

ttree/chromelogger

A TYPO3 Flow Logger Backend to send log the the Chrome Console

  • Wednesday, January 21, 2015
  • by ttree
  • Repository
  • 3 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

A TYPO3 Flow Logger Backend to send log the the Chrome Console

The Logger Backend can display your application in the Chrome Console, with the extension "Chrome Logger"., (*1)

Sample image based on the TYPO3 Neos Demo Site, (*2)

How to use it ?

You need to configure the Logger Backend in Settings.yaml::, (*3)

TYPO3:
  Flow:
    log:
      systemLogger:
        backend:
          0: 'TYPO3\Flow\Log\Backend\FileBackend'
          1: 'Ttree\ChromeLogger\Log\Backend\ChromeConsoleBackend'
        backendOptions:
          0:
            logFileURL: '%FLOW_PATH_DATA%Logs/System_Development.log'
            createParentDirectories: TRUE
            severityThreshold: '%LOG_INFO%'
            maximumLogFileSize: 10485760
            logFilesToKeep: 1
            logMessageOrigin: FALSE
          1:
            severityThreshold: '%LOG_CRIT%'

By default the package use a grouped output to show log on mulitple lines:, (*4)

Default Output, (*5)

Use it in your own package

You can use the default system logger provided by Flow, but you can also inject the ChomeLoggerServive in your own class., (*6)

Check the following code for some example:, (*7)

$this->chromeLoggerInstance->log('Foo');
$this->chromeLoggerInstance->info('Foo');
$this->chromeLoggerInstance->warn('Foo');
$this->chromeLoggerInstance->error('Foo');

// You can group your log entry, groupCollapsed method for a more compact rendering
$this->chromeLoggerInstance->group('String');
$this->chromeLoggerInstance->log('Foo');
$this->chromeLoggerInstance->log(array('Foo'));
$this->chromeLoggerInstance->groupEnd();

$this->chromeLoggerInstance->group('Table');
$this->chromeLoggerInstance->table('Foo');
$this->chromeLoggerInstance->table(array('Foo'));
$this->chromeLoggerInstance->groupEnd();

$this->chromeLoggerInstance->group('Object');
$this->chromeLoggerInstance->log($this->request->getHttpRequest());
$this->chromeLoggerInstance->log(new \DateTime());
$this->chromeLoggerInstance->groupEnd();

Warning: HTTP Header are limited to 256kb, currently if you hit the limit, you wont see any logs in the console., (*8)

Sample image with more advanced log values, (*9)

TODO

Feel free to open issue if you need a specific feature and better send a pull request. Here are some idea for future improvements:, (*10)

  • Support for exception and backtrace
  • Add support for Header compression (gzip) to mitigate the 256kb limit (need change in the Chrome extension too)
  • Better reflexion, maybe

Acknowledgments

Development sponsored by ttree ltd - neos solution provider., (*11)

License

Licensed under GPLv3+, see LICENSE, (*12)

The Versions

21/01 2015

dev-master

9999999-dev

A TYPO3 Flow Logger Backend to send log the the Chrome Console

  Sources   Download

The Requires

 

20/01 2015

0.9

0.9.0.0

A TYPO3 Flow Logger Backend to send log the the Chrome Console

  Sources   Download

The Requires