Logging system for custom C# rule plugin

Hi!

I am creating a custom rule for C#.
If I want to add a logging system for my RoslynAnalyzer, since I cannot use the one from sonar-plugin-api, what is the alternative? I know that custom Logging solutions can cause problems with build logs.

Thank you!

Hello @andreeamuscalu,

Sorry for the delay in the response.

I need some clarification on what you are trying to achieve.

What kind of logging system?
Do you want to use the logging capabilities from Microsoft Extensions.Logging or implement your own?

I am not an expert on build logs, so I am not sure how your logging system could interfere with them.

If you want to use the sonar-plugin-api to propagate your logging, one suggestion I can tell you is to use some kind of proxy, like files, to store your logging.
Then from your plugin, after the analysis, you can retrieve them and propagate them as you wish.
We use this trick in sonar-dotnet here.

For the rest, I guess it would depend on what you want to do.

I hope this helps!