PHP code example of sevenecks / xlog

1. Go to this page and download the library: Download sevenecks/xlog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sevenecks / xlog example snippets




use SevenEcks\Xlog\Logger;

$xlog = new Logger;;
$xlog->clearLog();
$xlog->emergency('test');
$xlog->alert('test');
$xlog->critical('test');
$xlog->error('test');
$xlog->warning('test');
$xlog->notice('test');
$xlog->info('test');
$xlog->debug('test');

/**
 * System is unusable.
 *
 * @param string $message
 * @param array $context
 * @return void
 */
public function emergency($message, array $context = array());

/**
 * Action must be taken immediately.
 *
 * Example: Entire website down, database unavailable, etc. This should
 * trigger the SMS alerts and wake you up.
 *
 * @param string $message
 * @param array $context
 * @return void
 */
public function alert($message, array $context = array());

/**
 * Critical conditions.
 *
 * Example: Application component unavailable, unexpected exception.
 *
 * @param string $message
 * @param array $context
 * @return void
 */
public function critical($message, array $context = array());

/**
 * Runtime errors that do not ge
 * @param array $context
 * @return void
 */
public function info($message, array $context = array());

/**
 * Detailed debug information.
 *
 * @param string $message
 * @param array $context
 * @return void
 */
public function debug($message, array $context = array());

/**
 * Logs with an arbitrary level.
 *
 * @param mixed $level
 * @param string $message
 * @param array $context
 * @return void
 */
public function log($level, $message, array $context = array());

public function __construct($file_name = 'xlog.log', $append_to_file = true, $string_utils = null, ColorInterface $colorize = null)

/**
 * Clear the log file
 *
 * @return int
 */
public function clearLog()