| Server IP : 23.111.136.34 / Your IP : 216.73.216.136 Web Server : Apache System : Linux servidor.eurohost.com.br 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : meusitei ( 1072) PHP Version : 5.6.40 Disable Function : show_source, system, shell_exec, passthru, proc_open MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/meusitei/www/wp-content/plugins/searchwp/vendor/ |
Upload File : |
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
// In order to accommodate for PHP 5.2 this needs to be abstracted to it's own file and conditionally included
if ( ! defined( 'ABSPATH' ) || ! defined( 'SEARCHWP_VERSION' ) ) {
exit;
}
include_once( SWP()->dir . '/vendor/monolog/vendor/autoload.php' );
class SearchWP_Monolog {
protected $logger;
function __construct( $logfile = '' ) {
$pid = SWP()->get_pid();
$full_pid = apply_filters( 'searchwp_debug_include_pid', false );
if ( empty( $full_pid ) ) {
$pid = substr( $pid, strlen( $pid ) - 5, strlen( $pid ) );
}
$stream = new StreamHandler( $logfile, Logger::DEBUG );
// finally, create a formatter
if ( class_exists( '\Monolog\Formatter\LineFormatter' ) ) {
// the default date format is "Y-m-d H:i:s"
$dateFormat = "Y-m-d H:i:s";
// the default output format is "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n"
$output = "%datetime% [%channel%] %message%\n";
$formatter = new \Monolog\Formatter\LineFormatter( $output, $dateFormat );
$stream->setFormatter( $formatter );
}
$this->logger = new Logger( $pid );
$this->logger->pushHandler( $stream );
}
function log( $message = '', $type = 'notice' ) {
$message = sanitize_textarea_field( esc_html( $message ) );
$message = str_replace( '=>', '=>', $message ); // put back array identifiers
$message = str_replace( '->', '->', $message ); // put back property identifiers
$message = str_replace( ''', "'", $message ); // put back apostrophe's
$this->logger->debug( (string) $message );
}
}