Logger

Integrate a custom logger into the pdf-optimizer package using the logger method. This empowers you to capture detailed logs and gain insights into the optimization process, aiding in debugging and monitoring.

A logger, is a class that implements Psr\Log\LoggerInterface, utilized for logging activities. A recommended logging library that fully complies with this interface is Monolog. The pdf-optimizer package utilizes the logger to record information such as the Optimizers used, executed commands, and their respective outputs in the log files.

use App\Logger;
use Mostafaznv\PdfOptimizer\PdfOptimizer;

$logger = new Logger;

PdfOptimizer::init()->logger($logger)->optimize('input.pdf', 'output.pdf');

Last updated