Warning
The Coralogix PHP SDK will End of Life(EOL) Feb 1st 2024.
For PHP 7.4+, please use the Coralogix’s PHP OpenTelemetry Instrumentation Documentation instead.
Yii2 integration¶
For using with Yii2
you should install yii2-monolog plugin and our logger handler to components:
use Coralogix\Handlers\CoralogixMonologHandler;
//....
return [
//....
'components' => [
'monolog' => [
'class' => '\Mero\Monolog\MonologComponent',
'channels' => [
'main' => [
'handler' => [
[
'type' => 'stream',
'path' => '@app/runtime/logs/main_' . date('Y-m-d') . '.log',
'level' => 'debug'
],
new Coralogix\Handlers\CoralogixMonologHandler(
"[YOUR_PRIVATE_KEY_HERE]",
"[YOUR_APPLICATION_NAME]",
"[YOUR_SUBSYSTEM_NAME]"
)
],
'processor' => [],
]
],
],
],
//....
];
To usage instruction, please, watch this manual.