File tree Expand file tree Collapse file tree 5 files changed +19
-187
lines changed Expand file tree Collapse file tree 5 files changed +19
-187
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ npm-debug.log*
55yarn-debug.log *
66yarn-error.log *
77lerna-debug.log *
8+ log.db
9+ log /
10+
11+ # Data generated by the app
12+ data /
813
914# Diagnostic reports (https://nodejs.org/api/report.html)
1015report. [0-9 ]* . [0-9 ]* . [0-9 ]* . [0-9 ]* .json
Original file line number Diff line number Diff line change @@ -46,8 +46,13 @@ if (args.log == 'false') {
4646 console . log ( "NOTICE: not creating file access.log" )
4747} else {
4848// Use morgan for logging to files
49+ const logdir = './log/' ;
50+
51+ if ( ! fs . existsSync ( logdir ) ) {
52+ fs . mkdirSync ( logdir ) ;
53+ }
4954// Create a write stream to append to an access.log file
50- const accessLog = fs . createWriteStream ( 'access.log' , { flags : 'a' } )
55+ const accessLog = fs . createWriteStream ( logdir + 'access.log' , { flags : 'a' } )
5156// Set up the access logging middleware
5257 app . use ( morgan ( 'combined' , { stream : accessLog } ) )
5358}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11const database = require ( 'better-sqlite3' )
22
3- const logdb = new database ( 'log.db' )
3+ const fs = require ( 'fs' ) ;
4+ const datadir = './data/' ;
5+
6+ if ( ! fs . existsSync ( datadir ) ) {
7+ fs . mkdirSync ( datadir ) ;
8+ }
9+
10+ const logdb = new database ( datadir + 'log.db' )
411
512const stmt = logdb . prepare ( `SELECT name FROM sqlite_master WHERE type='table' and name='accesslog';` )
613let row = stmt . get ( ) ;
You can’t perform that action at this time.
0 commit comments