People have done this many different ways over the years, most depending on third-party services of some kind.
There’s an FAQ on this, although it’s somewhat out of date, but it might give you a place to start. Also, I don’t know what will be available once the transition to the new platform architecture is done.
ROUNDUP: Data Logging and Charting Solutions
You can also see past discussions under the “logging“ tag in this forum, but since groovy will be going away soon, again, I don’t know what will work on the new architecture.