We've found that over time a lot of .xel files are stored in sql server and it will unnecessary fill the space on the drive (we don't need them after a while). Also, the associated Extended Event Session might be not ended.
We have a cleanup job that is triggered every week and it cleans unused files.
Is there a way to delete these files via c# code or SQL ?
How to find the .xel (using c# or sql) files I am interested in (related to a certain session) ?
If I drop an SQL extended event session, will it clear its .xel logs ?
Any suggestions would be very appreciated.