Specify that logs should be created relative to the current working directory.
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ import os from 'os';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import anonymize from 'ip-anonymize';
|
import anonymize from 'ip-anonymize';
|
||||||
import { importTrigger, importStatus } from './import.mjs'
|
import { importTrigger, importStatus } from './import.mjs'
|
||||||
import process from'process';
|
import process from 'process';
|
||||||
import { spawn } from 'child_process'
|
import { spawn } from 'child_process'
|
||||||
// import fs from 'fs'
|
// import fs from 'fs'
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ const server = app
|
|||||||
const lang = req.params.lang
|
const lang = req.params.lang
|
||||||
|
|
||||||
const ip = anonymize(req.headers['x-forwarded-for'] || req.socket.remoteAddress)
|
const ip = anonymize(req.headers['x-forwarded-for'] || req.socket.remoteAddress)
|
||||||
const log = `${process.env.HOME}/lean4game/logs/game-access.log`
|
const log = `${process.cwd()}/logs/game-access.log`
|
||||||
const header = "date;anon-ip;game;lang\n"
|
const header = "date;anon-ip;game;lang\n"
|
||||||
const data = `${new Date()};${ip};${owner}/${repo};${lang}\n`
|
const data = `${new Date()};${ip};${owner}/${repo};${lang}\n`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user