Download the PHP package silinternational/yii2-jsonsyslog without Composer
On this page you can find all versions of the php package silinternational/yii2-jsonsyslog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download silinternational/yii2-jsonsyslog
More information about silinternational/yii2-jsonsyslog
Files in silinternational/yii2-jsonsyslog
Download silinternational/yii2-jsonsyslog
More information about silinternational/yii2-jsonsyslog
Files in silinternational/yii2-jsonsyslog
Vendor silinternational
Package yii2-jsonsyslog
Short Description Yii2 log target for sending data to Syslog as a JSON encoded string
License MIT
Package yii2-jsonsyslog
Short Description Yii2 log target for sending data to Syslog as a JSON encoded string
License MIT
Please rate this library. Is it a good library?
Informations about the package yii2-jsonsyslog
Yii2-JsonSyslog
Yii2 log target for sending data to Syslog as a JSON encoded string, useful services such as Logentries.
Tips
Only send the JSON content
Make sure that the template you define for Logentries in your rsyslog.conf file does not add other content before the data (aside from your Logentries key). For example, do something like this...
$template Logentries,"LOGENTRIESKEY %msg%\n"
... NOT like this...
$template Logentries,"LOGENTRIESKEY %HOSTNAME% %syslogtag%%msg%\n"
Have the log prefix (if used) return JSON
Example (to be placed into your Yii2 config file's array):
[
'class' => 'sil\log\JsonSyslogTarget',
'levels' => ['error', 'warning'],
'except' => [
'yii\web\HttpException:401',
'yii\web\HttpException:404',
],
'logVars' => [], // Disable logging of _SERVER, _POST, etc.
'prefix' => function($message) use ($APP_ENV) {
$prefixData = array(
'env' => $APP_ENV,
);
if (! \Yii::$app->user->isGuest) {
$prefixData['user'] = \Yii::$app->user->identity->email;
}
return \yii\helpers\Json::encode($prefixData);
},
],
License
This is released under the MIT license (see LICENSE file).
All versions of yii2-jsonsyslog with dependencies
PHP Build Version
Package Version
The package silinternational/yii2-jsonsyslog contains the following files
Loading the files please wait ....