Skip to content

Conversation

@cewald
Copy link
Contributor

@cewald cewald commented May 18, 2020

Short Description and Why It's Useful

I tried to implement application-side monitoring using DataDog, but I stumbled about fact that I cant find entrypoints to implement my code without changing the core.

These are some suggestions for events to implement to make the VSF more accessible for changes.

beforeLogRendered mutator-hook

I added a beforeLogRendered mutator-hook to be able to implement a custom logger (winston in my case) or mutate the log messages. This way I can add the hook in a module and optionally "disable" the default logging output if needed – like in my case as I use a custom logging library with a custom format.

I also changed some missing Logger class implementations in the code where still console.log was used.

ssrException event-hook

This is an event hook to be called when an exception is happening on server-side rendering.

My use-case for this was that I wanted to track exceptions using this event to create a healt-check for the running application process.

httpServerIsReady event-hook

This event is triggered just once when the ExpressJS server is ready and would be handy if you for example wan't to bind to http.server events.

In my case I needed this (again) for my process health-check when I implemented lightship to give the signal that the server is ready.


These are just suggestions and maybe are mostly not necessary to run the shop in general but are handy if you need to extend it. I think these entrypoints would be useful for other usecases as well and won't have any impact if not needed.

Which Environment This Relates To

Check your case. In case of any doubts please read about Release Cycle

  • Test version (https://test.storefrontcloud.io) - this is a new feature or improvement for Vue Storefront. I've created branch from develop branch and want to merge it back to develop
  • RC version (https://next.storefrontcloud.io) - this is a stabilisation fix for Release Candidate of Vue Storefront. I've created branch from release branch and want to merge it back to release
  • Stable version (https://demo.storefrontcloud.io) - this is an important fix for current stable version. I've created branch from hotfix or master branch and want to merge it back to hotfix

Upgrade Notes and Changelog

  • No upgrade steps required (100% backward compatibility and no breaking changes)
  • I've updated the Upgrade notes and Changelog on how to port existing Vue Storefront sites with this new feature

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and Currently Important Rules Acceptance

@vercel
Copy link

vercel bot commented May 18, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/shopware-pwa/vue-storefront/d9zqdv0sv
✅ Preview: https://vue-storefront-git-fork-icmaa-feature-improve-events-and-a9da25.shopware-pwa.now.sh

@vercel vercel bot temporarily deployed to preview May 18, 2020 10:49 Inactive
@vercel vercel bot temporarily deployed to preview May 18, 2020 10:50 Inactive
@vercel vercel bot temporarily deployed to preview May 18, 2020 11:43 Inactive
Copy link
Contributor

@gibkigonzo gibkigonzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, please resolve conflicts

@gibkigonzo gibkigonzo added this to the 1.12.0-rc1 milestone May 22, 2020
@vercel vercel bot temporarily deployed to preview May 22, 2020 09:59 Inactive
@cewald
Copy link
Contributor Author

cewald commented May 22, 2020

@gibkigonzo Done

@gibkigonzo gibkigonzo merged commit 60a8b51 into vuestorefront:develop May 22, 2020
@cewald cewald deleted the feature/improve-events-and-logging branch May 23, 2020 07:40
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.

2 participants