Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Persist app bootstrapping logs for logger datacollector#21502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| private$containerBuildLogs = []; | ||
| publicfunction__construct(Filesystem$filesystem,$logger =null,$cacheDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this cannot be required. It is a BC break.
And adding a new argument at the beginning is even worse.
| publicfunctionpersistContainerBuildLogs() | ||
| { | ||
| $datas = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
no short array syntax please
| if ($this->isSilencedOrDeprecationErrorLog($log)) { | ||
| if ($log['context']['exception']instanceof SilencedErrorContext) { | ||
| ++$count['scream_count']; | ||
| }elseif (isset($log['context'][BufferingLogger::BOOTSTRAPPING_FLAG])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is adding a hard dependency to the Debug component to read the constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There is already a dependency to the debug component on theSilencedErrorContext. I understand that it create a (second) hard dependency between those components, a hard coded key would be better?
| $datas =unserialize($rawContent); | ||
| $this->data['container_build_count'] =$datas['container_logs']; | ||
| $this->data['container_build_logs'] =$this->sanitizeLogs($datas['logs']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
sanitizing must be done before dumping. Otherwise, you have no guarantee that the logs will be serializable (the context can contain objects)
stof commentedFeb 1, 2017
@nicolas-grekas I'm not sure about this approach. Can you check it ? |
stof commentedFeb 1, 2017
Naming the tab |
ScullWM commentedFeb 2, 2017
|
47d826d toa329dcfComparefabpot commentedMar 5, 2017
ping@nicolas-grekas |
ScullWM commentedMar 7, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sorry but recents updates on master have interactions with this PR and it look like it's not working anymore. Edit: My bad idea was to think that if there are some flagged logs, it mean that we are bootstrapping the app. But in some case, the Difficulty is to detect if a new application bootstrapping have been made from the Investigating on it... |
ScullWM commentedMar 22, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
d186274 to69fd3feCompareScullWM commentedApr 5, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I've updated this PR to implement full tests of I hope it will help other devs to update easily their Symfony version (finding deprecation and logs who rarely happen). |
nicolas-grekas commentedApr 7, 2017
can you please rebase against master to remove merge commits in the current git history in this PR? |
nicolas-grekas left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Last comment I guess :)
Looking at the screenshot, I think only the file + line info is usefull - not the full context array (scream & co are useless, message is duplication)
| $containerDeprecationLogs =$this->getContainerDeprecationLogs(); | ||
| $this->data['deprecation_count'] +=count($containerDeprecationLogs); | ||
| $this->data['container_compiler_logs'] =$this->getContainerCompilerLogs(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
let's rename this to compiler_logs to be consistent with the public methodgetCompilerLogs
| 'line' =>$line, | ||
| ); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
should be removed
nicolas-grekas commentedApr 14, 2017
Also, the "Container Compilation" count needs a fix |
9a58cf1 to0d4b75fComparenicolas-grekas commentedApr 17, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@ScullWM FYI I pushed on your branch on your fork, adding a 2nd commit + tweaking yours a bit to fine tune DX. Here is a screenshot, showing:
|
b719e10 to99442edCompare
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍
99442ed to7dd5c90Compare7dd5c90 to2fd18b5Comparenicolas-grekas commentedApr 17, 2017
(fabbot failures are false-positives in this case) |
fabpot commentedApr 20, 2017
Thank you@ScullWM. |
…r (ScullWM, nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------Persist app bootstrapping logs for logger datacollector| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | no| New feature? | yes| BC breaks? | ?| Deprecations? | no| Tests pass? | yes| Fixed tickets |#21405| License | MITLogs generated during the container build are catched by the BufferingLogger with a special flag.They are persist by the LoggerDataCollector and are available in the logger profiler.In the profiler toolbar, the "container build" logs increment the current logs counter (even if the container was previously built).<img width="540" alt="capture d ecran 2017-02-01 a 20 56 40" src="https://cloud.githubusercontent.com/assets/1017746/22523826/0bc12e4a-e8c1-11e6-830f-7f6238ea7423.png"><img width="1022" alt="capture d ecran 2017-02-01 a 20 57 55" src="https://cloud.githubusercontent.com/assets/1017746/22523859/2c48a698-e8c1-11e6-9bdb-d85f3e692938.png">The BufferingLogger now require the cachePath and the filesystem to persist a (unique) container build logs.If the current workflow is ok, I will update the test coverage (actually they fail). Maybe we can display the appDevDebugProjectContainerCompiler.log content in that logger profile.Commits-------2fd18b5 [VarDumper] Fine tune dumping log messagesce3ef6a Persist app bootstrapping logs for logger datacollector
…ollector (ScullWM, nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------Persist app bootstrapping logs for logger datacollector| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | no| New feature? | yes| BC breaks? | ?| Deprecations? | no| Tests pass? | yes| Fixed tickets |symfony#21405| License | MITLogs generated during the container build are catched by the BufferingLogger with a special flag.They are persist by the LoggerDataCollector and are available in the logger profiler.In the profiler toolbar, the "container build" logs increment the current logs counter (even if the container was previously built).<img width="540" alt="capture d ecran 2017-02-01 a 20 56 40" src="https://cloud.githubusercontent.com/assets/1017746/22523826/0bc12e4a-e8c1-11e6-830f-7f6238ea7423.png"><img width="1022" alt="capture d ecran 2017-02-01 a 20 57 55" src="https://cloud.githubusercontent.com/assets/1017746/22523859/2c48a698-e8c1-11e6-9bdb-d85f3e692938.png">The BufferingLogger now require the cachePath and the filesystem to persist a (unique) container build logs.If the current workflow is ok, I will update the test coverage (actually they fail). Maybe we can display the appDevDebugProjectContainerCompiler.log content in that logger profile.Commits-------2fd18b5 [VarDumper] Fine tune dumping log messagesce3ef6a Persist app bootstrapping logs for logger datacollector
This PR was merged into the 4.2-dev branch.Discussion----------CacheWarmerAggregate handle deprecations logs| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#27387| License | MITActually the Web Debug Toolbar warning you about the deprecation messages thrown during the container built (#21502).Cache warmup can throw deprecated message without any persistance, it may cause issue like#27387This PR reproduce the same job for the cache warmer, and so on, handle deprecated messages during the warmup of Twig, Translator, Validator, Security and all `kernel.cache_warmer` services.Here are the point that may be improvable in this PR:1. Actually I've "duplicate" the callable used in the `set_error_handler` of the Kernel.IMHO I think that Kernel and CacheWarmerAggregate have differents jobs and a trait may be a good solution to share this error handler setter without duplicating the code, but I'm a little bit lost about the repercussion of adding a Trait in the Kernel.2. I've think about extending the `CacheWarmerAggregate` into a `DeprecatedLogHandlingCacheWarmerAggregate` to add the debug and containerClass argument, and declare it as the `cache_warmer` service only in debug mode (by declaring it in the DebugBundle/Resources/config/services.xml).Commits-------f03b8bb CacheWarmerAggregate handle deprecations logs



Uh oh!
There was an error while loading.Please reload this page.
Logs generated during the container build are catched by the BufferingLogger with a special flag.
They are persist by the LoggerDataCollector and are available in the logger profiler.
In the profiler toolbar, the "container build" logs increment the current logs counter (even if the container was previously built).
The BufferingLogger now require the cachePath and the filesystem to persist a (unique) container build logs.
If the current workflow is ok, I will update the test coverage (actually they fail). Maybe we can display the appDevDebugProjectContainerCompiler.log content in that logger profile.