EvoEsports / EvoSC-sharp

Next generation server controller for Trackmania written in C# using .NET 8.
https://evosc.io
GNU General Public License v3.0
21 stars 13 forks source link

Audit Logging #117

Closed snixtho closed 1 year ago

snixtho commented 1 year ago

Scoped events! We can now keep state throughout an entire event, and dispose of those resources when the events ends. This was a necessary step to introduce the new context-based audit logging. This pull request adds a way to log auditable events into the database or the logger. This opens up a new area of possibilities, which hasn't really been done before in any server controller in TM.

The pull request also implements an API that can be used both inside and outside of a context. The context-based logging will allow you to modify the audit throughout an entire event. For example, if you need to set properties that is only available at different places. You can also cancel the audit log if needed.

Audit logs supports 3 different states; info, success and error. In addition, a fluent builder is provided that makes it easy to set up an audit anywhere, either manually, through the context, the context service or the audit service.

Logs should be easily parseable and it is also possible to read the database to display the logs in-game or externally.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

38.2% 38.2% Coverage
0.0% 0.0% Duplication