mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			504 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			504 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
 | 
						|
const fs = require('fs');
 | 
						|
const dateUtils = require('../../services/date_utils');
 | 
						|
const {LOG_DIR} = require('../../services/data_dir.js');
 | 
						|
 | 
						|
function getBackendLog() {
 | 
						|
    const file = `${LOG_DIR}/trilium-${dateUtils.localNowDate()}.log`;
 | 
						|
 | 
						|
    try {
 | 
						|
        return fs.readFileSync(file, 'utf8');
 | 
						|
    }
 | 
						|
    catch (e) {
 | 
						|
        // most probably the log file does not exist yet - https://github.com/zadam/trilium/issues/1977
 | 
						|
        return "";
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
module.exports = {
 | 
						|
    getBackendLog
 | 
						|
};
 |