Skip to content

fix(compiler): set log file path when writeLog is enabled#6655

Merged
johnjenkins merged 1 commit intostenciljs:mainfrom
cyphercodes:fix-log-file-writing
Mar 27, 2026
Merged

fix(compiler): set log file path when writeLog is enabled#6655
johnjenkins merged 1 commit intostenciljs:mainfrom
cyphercodes:fix-log-file-writing

Conversation

@cyphercodes
Copy link
Copy Markdown
Contributor

Summary

This PR fixes the issue where stencil build --log does not write a log file to disk even though the CLI flag is documented to do so.

Problem

When running stencil build --log, the writeLog config was correctly set to true and buildLogFilePath was validated, but the logger was never informed of the log file path. The terminal-logger.ts has a setLogFilePath method and writeLogs method, but setLogFilePath was never called during config validation.

Solution

Call logger.setLogFilePath() in validate-config.ts after validatePaths() sets the buildLogFilePath when writeLog is enabled.

Changes

  • Added a call to logger.setLogFilePath(validatedConfig.buildLogFilePath) in src/compiler/config/validate-config.ts

fixes: #6632

Call logger.setLogFilePath() when buildLogFilePath is set during config
validation. This ensures that the --log CLI flag actually writes logs to
disk as documented.

fixes: stenciljs#6632
@cyphercodes cyphercodes requested a review from a team as a code owner March 27, 2026 01:01
@johnjenkins johnjenkins added this pull request to the merge queue Mar 27, 2026
Merged via the queue into stenciljs:main with commit 3d95083 Mar 27, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: stencil build --log is not writing any file

2 participants