Logger
This commit is contained in:
@@ -6,9 +6,10 @@ class Dash extends Users_Controller {
|
|||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
$this->logger->info('Dash extends Users_Controller contructor');
|
||||||
redirect(home);
|
if (!isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
||||||
}
|
redirect(home);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function help(){
|
public function help(){
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Gelf\Transport;
|
||||||
|
use Monolog\Level;
|
||||||
|
use Monolog\Logger;
|
||||||
|
use Monolog\Handler\GelfHandler;
|
||||||
|
|
||||||
class WRB_Controller extends CI_Controller {
|
class WRB_Controller extends CI_Controller {
|
||||||
|
|
||||||
var $template = array(
|
var $template = array(
|
||||||
@@ -23,8 +28,6 @@ class WRB_Controller extends CI_Controller {
|
|||||||
'table_close' => '</table>'
|
'table_close' => '</table>'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var $template_nohead = array(
|
var $template_nohead = array(
|
||||||
'table_open' => "<table class='table table-striped table-hover table-bordered table-condensed'>",
|
'table_open' => "<table class='table table-striped table-hover table-bordered table-condensed'>",
|
||||||
'thead_open' => '<thead>',
|
'thead_open' => '<thead>',
|
||||||
@@ -45,12 +48,27 @@ class WRB_Controller extends CI_Controller {
|
|||||||
'cell_alt_end' => '</td>',
|
'cell_alt_end' => '</td>',
|
||||||
'table_close' => '</table>'
|
'table_close' => '</table>'
|
||||||
);
|
);
|
||||||
|
|
||||||
public $data = array();
|
public $data = array();
|
||||||
|
|
||||||
|
var $logger;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->load->library(array('session', 'lib_login'));
|
$this->load->library(array('session', 'lib_login'));
|
||||||
|
|
||||||
|
// Create the logger
|
||||||
|
$this->logger = new Logger($_SERVER['SERVER_ADDR']);
|
||||||
|
|
||||||
|
// Create Graylog GELF TCP transport
|
||||||
|
$transport = new Gelf\Transport\TcpTransport("10.0.0.112",12201);
|
||||||
|
|
||||||
|
// Create GELF handler
|
||||||
|
$handler = new GelfHandler(new Gelf\Publisher($transport));
|
||||||
|
|
||||||
|
// Now add GELF handler to logger
|
||||||
|
$this->logger->pushHandler($handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function paginationConfig($urlSeg,$perPage,$numRows,$linkPath,$numLnk){
|
public function paginationConfig($urlSeg,$perPage,$numRows,$linkPath,$numLnk){
|
||||||
|
|||||||
+3
-1
@@ -17,7 +17,9 @@
|
|||||||
"phpseclib/phpseclib": "^3.0",
|
"phpseclib/phpseclib": "^3.0",
|
||||||
"hybridauth/hybridauth" : "~3.7.1",
|
"hybridauth/hybridauth" : "~3.7.1",
|
||||||
"google/apiclient":"^2.12.1",
|
"google/apiclient":"^2.12.1",
|
||||||
"paragonie/sodium_compat": "^1.17"
|
"paragonie/sodium_compat": "^1.17",
|
||||||
|
"monolog/monolog": "^2.8",
|
||||||
|
"graylog2/gelf-php": "^1.7"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||||
|
|||||||
Reference in New Issue
Block a user