Skip to content

Commit 3b413b1

Browse files
committed
tryfix...
1 parent 19a44da commit 3b413b1

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

server.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ function deploy(config, ready) {
4242
return path.posix.join(...url.split(path.sep));
4343
}
4444

45-
let txtLogger = undefined;
46-
if (config.log !== "") {
47-
txtLogger = fs.createWriteStream(config.log, {
48-
flags: 'as'
49-
});
50-
}
51-
5245
server.on('request', (request, response) => {
5346
let data = '';
5447

@@ -59,7 +52,7 @@ function deploy(config, ready) {
5952
request.on('end', () => {
6053
if (config.log !== "") {
6154
let now = config.logTime ? `[${formatTime.format(new Date())}] ` : '';
62-
txtLogger.write(`${now}${request.method} ${request.url} ${JSON.stringify(data)}\n`);
55+
fs.writeFileSync(config.log, `${now}${request.method} ${request.url} ${JSON.stringify(data)}\n`);
6356
}
6457

6558
if (config.noCache) {

0 commit comments

Comments
 (0)