Performance Log Library

I want to start monitoring the performance of my applications by logging business events. I was looking for something similar to log4net or other log libraries, but specifically for monitoring performance and health.

My goal is to publish these business events using performance counters, but I don’t really want to interfere with my code using the performance counter code. Just like log4net, is there an existing library that abstracts performance / health monitoring in its own library?

+3
source share
1 answer

You should definitely try Gibraltar . You can combine it with PostSharp , and your monitoring of progress will be part of the cake. Just check out the following code example:

    [GTrace]
    public Connection ConnectToServer(Server server)
    {
        ConnectionStatus connectionStatus = server.TryConnect();
        return connectionStatus;
    }

And the result in the log will look like this:

Starting a method call (you can see the arguments passed) alt text

Call completion method

alt text

There is no crap in the code, the only thing you need is a single attribute. Attrubutes can be used for the entire project, excluding unnecessary methods, on namespaces, classes, or just on any methods that you need. Enjoy it!

Edit I forgot to mention that Gibraltar has a very rich client and supports any indicators you ever need, it is too powerful:  alt text

+6
source

Source: https://habr.com/ru/post/1781118/


All Articles