SharpCrafters Forum – Log4PostSharp or PostSharp Laos for logging

SharpCrafters Support Forum

        


Log4PostSharp or PostSharp Laos for logging Expand / Collapse
Author
Message
Posted 10/25/2008 1:31:24 PM


Community Member
Hi,
I have just started researching PostSharp to use on our current project for logging and am a bit confused.
It seems you can perform logging with either PostSharp Laos or Log4PostSharp.
What is the difference and which one would be the best to use?
Maybe I am missing that Log4Post uses Laos but I havent seen this.
Thanks for replies Noel
Post #3380
Posted 10/27/2008 5:55:55 PM


Michal Dabrowski

Community Member
Hi,

the difference is in performance. Log4PostSharp injects just logging statements (and injects them directly), while the code injected by Laos creates some auxiliary objects, not related to logging but supporting Laos features. In other words: Log4PostSharp has no overhead (your program works as fast as it would if you typed all the logging statements by hand) while Laos has overhead that you will suffer from (the more methods the logging aspect is applied to the more you will feel it - and it can get *very* noticeable).

The overhead of Laos is negligible for most aspects - but not for logging IMO. This is because logging aspects are usually applied very "broadly", i.e. to most (if not all) methods in the code.
Post #3381
Posted 10/27/2008 7:52:02 PM


Community Member
Michal,
Thanks for reply, hope to start using  Log4PostSharp next week.
Had a look at the demo code and the methods take in simple types. I was wondering is there a way to log the properties of an object been passed in as a parameter. e.g. a customer object is passed into a method and I want to log the customer id and name.
Thanks again Noel
Post #3382
« Prev Topic | Next Topic »


All times are GMT +1:00, Time now is 1:55am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.117. 9 queries. Compression Disabled.