xdrm-framework/notice/log/1.0.md

845 B

module: log
version: 1.0
requires: null

Overview

1. Introduction

The log package allows you to manage multiple log files through simple code.

2. Log format

timestamp | date | [tag] logmessage

Example:

1481495961 | 2016-12-21 23:39:21 | [api_error] some content message

3. Log file location

Log files are located at /build/log/log/{logfile}.php.

Usage

  1. Include the autoloader
<?php

	require_once '../autoloader.php';

	...
  1. Load the Log class
<?php

	...

	use \log\core\Log;

  1. Fetch the log file you want ("error" in this example)
<?php

	...

	Log::get('error');

	...
  1. log something on a specific log file ("error" in this example)
<?php

	...

	Log::get('error')->log('some message', 'optional_tag');

	...