2017 © Pedro Peláez
 

library yii-formattedfilelogroute

This log route extends CFileLogRoute and gives you ability to specify log format.

image

urmaul/yii-formattedfilelogroute

This log route extends CFileLogRoute and gives you ability to specify log format.

  • Monday, January 11, 2016
  • by urmaul
  • Repository
  • 1 Watchers
  • 0 Stars
  • 174 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1 % Grown

The README.md

Formatted FileLogRoute for Yii Framework

This log route extends CFileLogRoute and gives you ability to specify log format., (*1)

How to attach

Add route config to log routes. It will look like this:, (*2)

array(
    'class'      => 'ext.formattedfilelogroute.FormattedFileLogRoute',
    'format'     => "{time}\t{ip}\t{msg}",
    'categories' => 'application',
    'logFile'    => 'formatted.log',
),

Log variables

You can use these variables in your log format:, (*3)

  • {ip} - client ip
  • {uri} - request URI
  • {ref} - request referer
  • {sref} - short request referer (domain name is removed if referer domain is current domain)
  • {time} - current time
  • {level} - log message level
  • {category} - log message category
  • {message} - full log message text
  • {msg} - log message text without stack trace
  • {trace} - stack trace

Suggested routes

array(
    'class'   => 'ext.formattedfilelogroute.FormattedFileLogRoute',
    'format'  => "{time}\t{ip}\t{category}\t{uri}\t{message}",
    'except'  => 'exception.CHttpException.404',
    'levels'  => 'error',
    'logFile' => 'error.log',
),
array(
    'class'      => 'ext.formattedfilelogroute.FormattedFileLogRoute',
    'format'     => "{time}\t{ip}\t{uri}\t{sref}",
    'categories' => 'exception.CHttpException.404',
    'logFile'    => 'error404.log',
),

The Versions

11/01 2016

dev-master

9999999-dev https://github.com/urmaul/formattedfilelogroute

This log route extends CFileLogRoute and gives you ability to specify log format.

  Sources   Download

MIT

The Requires

 

log file route yii

11/01 2016

v1.1.0

1.1.0.0 https://github.com/urmaul/formattedfilelogroute

This log route extends CFileLogRoute and gives you ability to specify log format.

  Sources   Download

MIT

The Requires

 

log file route yii

07/07 2014

v1.0.0

1.0.0.0 https://github.com/urmaul/formattedfilelogroute

This log route extends CFileLogRoute and gives you ability to specify log format.

  Sources   Download

MIT

The Requires

 

log file route yii