|
|
|
Community Member
|
|
|
I've looked through the code but am apparently blindly missing this. Where do you specify which logger (defined in your app.config file, for instance) Log4PostSharp will use? As far as I can tell, it always uses the root logger, but surely I'm missing it.
|
|
|
|
|
Michal Dabrowski
Community Member
|
|
|
For every class that contains methods decorated with the Log attribute, Log4PostSharp creates separate logger instance. Name of the logger is set to the name of the class, including the namespace it is declared in.
|
|
|
|
|
Community Member
|
|
Hi folks. Our team uses Log4PostSharp and we have augmented it with two new attributes (no Laos, pure hard core PostSharp): - LoggerAttribute Allows to specify an explicit logger name for a class. For generic classes there is overloaded attribute constructor allowing to specify the logger name policy for the generic types. Of course, if particular generic type parameter is also attributed with the LoggerAttribute, then the explicit name takes always precedence. This attribute is not multicast. - LoggerPolicyAttribute This multicast attribute allows to change the policy used by the Log4PostSharp when choosing the logger name. It allows to select between Type.Name, Type.FullName and Type.AssemblyQualifiedName.
We find these attributes extremely useful, since they make logs much more readable. I wish to submit our changes to the community, but do not know how. Anyone wishing to get the source may contact me at mark dot kharitonov (no spam please) at gmail dot com
|
|
|
|