Introducing Log4PostSharp

by Gael Fraiteur on 07 Aug 2008

Yet another blogging about AOP blogging? This time, read further.

I know logging is the Hello, world! sample of aspect-oriented programming. It is the sample on the home page of, and many have blogged about that. However, all solutions I've seen so far use PostSharp Laos...

The problem with Laos is its impact on performance. Although it performs similarly or better than other AOP solutions, it cannot be compared to inlined code. And that's what Log4PostSharp does: it inlines logging instructions into your method body. Parameters are not boxed, no "eventArgs" object is created, no external aspect class is involved. Just pure instructions.

I almost forgot the most important: Log4PostSharp uses log4net as the backend.

Among the sweets you'll find: a quite powerful system to set up the logging string like {signature} or {@parameter_name}. All evaluated at build time (unless parameter values of course)!

The project is available under BSD license. A great work of Michal Dabrowski!

That's enough for me. For more info, please read Michal's introduction to Log4PostSharp.

Happy PostSharping!