Trying to log the time When Method is Called and When its completed its operation and return the values Exit Time.
this i am trying in N-tier architecture.Like
i. Service Layer
ii. Business layer
iii. Data Layer
Data Layer defined a Method A
, which is consumers by the Bushiness layer method B
. Business layer method B
is Called by Service Layer method D
.
the Log Will be Like
Service Method D Called At {Time Stamp}
Business Layer Method B Called At {Time Stamp}
Data Layer Method called at {Time Stamp}
Data Layer Returned Response at {Time Stamp} .Exiting
Business Layered Received response from Data layer at {Time Stamp}. Exiting
Service Layered Received exception from Business layer Method. at {Time Stamp}. Exiting
Currently i passing a additional string builder object for this to maintain log and respective time . appending current scope and Time Stamp.
Can i automate this process by dependency injection , so i can avoid passing that extra string builder object.or there is better solution for this.