mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	log data dir location
This commit is contained in:
		
							parent
							
								
									23e8e20d44
								
							
						
					
					
						commit
						a7831ebfcd
					
				| @ -1 +1 @@ | |||||||
| module.exports = { build_date:"2017-11-30T00:11:04-05:00", build_revision: "719f5530544efa1d7aae16afd8a9e64db04ff206" }; | module.exports = { build_date:"2017-12-04T23:02:48-05:00", build_revision: "23e8e20d44ef029e6891dec6d2d855d282996823" }; | ||||||
|  | |||||||
| @ -1,15 +1,15 @@ | |||||||
| "use strict"; | "use strict"; | ||||||
| 
 | 
 | ||||||
| const fs = require('fs'); | const fs = require('fs'); | ||||||
| const LOG_DIR = require('./data_dir').LOG_DIR; | const data_dir = require('./data_dir'); | ||||||
| 
 | 
 | ||||||
| if (!fs.existsSync(LOG_DIR)) { | if (!fs.existsSync(data_dir.LOG_DIR)) { | ||||||
|     fs.mkdirSync(LOG_DIR, 0o700); |     fs.mkdirSync(data_dir.LOG_DIR, 0o700); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const logger = require('simple-node-logger').createRollingFileLogger({ | const logger = require('simple-node-logger').createRollingFileLogger({ | ||||||
|     errorEventName: 'error', |     errorEventName: 'error', | ||||||
|     logDirectory: LOG_DIR, |     logDirectory: data_dir.LOG_DIR, | ||||||
|     fileNamePattern: 'trilium-<DATE>.log', |     fileNamePattern: 'trilium-<DATE>.log', | ||||||
|     dateFormat:'YYYY-MM-DD' |     dateFormat:'YYYY-MM-DD' | ||||||
| }); | }); | ||||||
| @ -37,6 +37,8 @@ function request(req) { | |||||||
|     logger.info(req.method + " " + req.url); |     logger.info(req.method + " " + req.url); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | info("Using data dir: " + data_dir.TRILIUM_DATA_DIR); | ||||||
|  | 
 | ||||||
| module.exports = { | module.exports = { | ||||||
|     info, |     info, | ||||||
|     error, |     error, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner