Skip to content

Commit b76bee1

Browse files
authored
bug: Fix log file location on Windows (#28)
* change the log file path to be cross-platform compatible * Update README file
1 parent b4470fc commit b76bee1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
npx mcp-server-nodejs-api-docs
2525
```
2626

27-
You can debug calls for the MCP Server by inspecting the file `/tmp/mcp-server-nodejs-docs.log` which this MCP Server writes to.
27+
You can debug calls for the MCP Server by inspecting the file `mcp-server-nodejs-docs.log` in your system's temporary directory (e.g., `/tmp` on Unix-like systems or `%TEMP%` on Windows) which this MCP Server writes to.
2828

2929
## Usage: as a Docker container
3030

src/utils/logger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { pino } from 'pino'
22
import type { Logger } from 'pino'
3+
import * as path from 'path'
4+
import * as os from 'os'
35

46
// Re-export pino types for use in other modules
57
export type { Logger } from 'pino'
68

7-
// @TODO change the log file path to be cross-platform compatible
8-
// and support other OSs
9-
const logFilePath = '/tmp/mcp-server-nodejs-docs.log'
9+
const logFilePath = path.join(os.tmpdir(), 'mcp-server-nodejs-docs.log')
1010

1111
export function initLogger (): Logger {
1212
const logLevel = process.argv.includes('--debug') ? 'debug' : 'info'

0 commit comments

Comments
 (0)