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