How to use code to register c #

I am wondering if there is a way to have some kind of aspect-oriented way to configure C # code logging. Or, if the code can be used to automatically log.

At the moment, the code is pierced Log("Enter method XXX")and Log("Leaving method XXX")that makes the service really tedious.

Ideally, I would like to have something that records automatically, just like libraries are for profiling.

The next best would be to have some custom attributes, it is possible that I can tag my methods. They would enter a registration code when entering and exiting the method.

And if the solution was compatible with EntLib, that would be great :)

Greetings.

+3
source share
4

Log4PostSharp. , , PostSharp .

+1

, , , , , . Enterprise , . , , . , , , , db, .. Enterrpise, .

, , , , , , . Enterprise Blocks Couchdb. Couchdb , REST Json, , , HTML-, , , :)

, , , , - , . , .

, .

0

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


All Articles