Class and Method Name Token in Text Formatter

Topics: Logging Application Block
Sep 17, 2010 at 8:54 PM


For a Log Message Text Formatter in EntLib 5, are there any tokens I can use in the "template" field to include the class and method name in the log entry?  e.g. something like "{property(ClassName)}"  I know I can use extended properties and manually pass in the class and log names when I create the LogEntry object, but I'm wondering if there's already an out-of-box approach.  I also know I can also use a stack trace, but that's way much more information than necessary.  I'm looking for a simple solution if it exists.


Sep 20, 2010 at 2:03 AM

There's no out-of-the-box tokens for the class and method name.   You can also use the approach of creating your own tokens which also involves putting it in the extended properties.  See this thread if you're interested in this approach.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.