mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 22:14:33 -04:00
Pipe hosted logs to gelf instead of text files
This commit is contained in:
parent
3a9ca8e6e1
commit
6af9f40f9e
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoice Ninja (https://invoiceninja.com).
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
*
|
*
|
||||||
@ -10,6 +9,8 @@
|
|||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple helper function that will log into "invoiceninja.log" file
|
* Simple helper function that will log into "invoiceninja.log" file
|
||||||
* only when extended logging is enabled.
|
* only when extended logging is enabled.
|
||||||
@ -32,6 +33,9 @@ function nlog($output, $context = []): void
|
|||||||
$trace = debug_backtrace();
|
$trace = debug_backtrace();
|
||||||
//nlog( debug_backtrace()[1]['function']);
|
//nlog( debug_backtrace()[1]['function']);
|
||||||
// \Illuminate\Support\Facades\Log::channel('invoiceninja')->info(print_r($trace[1]['class'],1), []);
|
// \Illuminate\Support\Facades\Log::channel('invoiceninja')->info(print_r($trace[1]['class'],1), []);
|
||||||
|
if(Ninja::isHosted())
|
||||||
|
info($output);
|
||||||
|
else
|
||||||
\Illuminate\Support\Facades\Log::channel('invoiceninja')->info($output, $context);
|
\Illuminate\Support\Facades\Log::channel('invoiceninja')->info($output, $context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user