Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
23813a77
Unverified
Commit
23813a77
authored
Oct 01, 2025
by
Jiachi Liu
Committed by
GitHub
Oct 01, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[mcp] logging file should be reset for each session (#84425)
parent
43aef82b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
file-logger.ts
packages/next/src/server/dev/browser-logs/file-logger.ts
+5
-6
No files found.
packages/next/src/server/dev/browser-logs/file-logger.ts
View file @
23813a77
...
...
@@ -8,6 +8,7 @@ export interface LogEntry {
message
:
string
}
// Logging server and browser logs to a file
export
class
FileLogger
{
private
logFilePath
:
string
=
''
private
isInitialized
:
boolean
=
false
...
...
@@ -29,12 +30,10 @@ export class FileLogger {
}
try
{
// Create the log file if it doesn't exist
if
(
!
fs
.
existsSync
(
this
.
logFilePath
))
{
// ensure the directory exists
fs
.
mkdirSync
(
path
.
dirname
(
this
.
logFilePath
),
{
recursive
:
true
})
fs
.
writeFileSync
(
this
.
logFilePath
,
''
)
}
// Clean up the log file on each initialization
// ensure the directory exists
fs
.
mkdirSync
(
path
.
dirname
(
this
.
logFilePath
),
{
recursive
:
true
})
fs
.
writeFileSync
(
this
.
logFilePath
,
''
)
this
.
isInitialized
=
true
}
catch
(
error
)
{
console
.
error
(
error
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment