fix(compiler): set log file path when writeLog is enabled#6655
Merged
johnjenkins merged 1 commit intostenciljs:mainfrom Mar 27, 2026
Merged
fix(compiler): set log file path when writeLog is enabled#6655johnjenkins merged 1 commit intostenciljs:mainfrom
johnjenkins merged 1 commit intostenciljs:mainfrom
Conversation
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
johnjenkins
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the issue where
stencil build --logdoes not write a log file to disk even though the CLI flag is documented to do so.Problem
When running
stencil build --log, thewriteLogconfig was correctly set totrueandbuildLogFilePathwas validated, but the logger was never informed of the log file path. Theterminal-logger.tshas asetLogFilePathmethod andwriteLogsmethod, butsetLogFilePathwas never called during config validation.Solution
Call
logger.setLogFilePath()invalidate-config.tsaftervalidatePaths()sets thebuildLogFilePathwhenwriteLogis enabled.Changes
logger.setLogFilePath(validatedConfig.buildLogFilePath)insrc/compiler/config/validate-config.tsfixes: #6632