http://logging.apache.org/log4net/release/sdk/log4net.Layout.PatternLayout.html Note about caller location information. The following patterns %type %file %line %method %location %class %C %F %L %l %M all generate caller location information. Location information uses the System.Diagnostics.StackTrace class to generate a call stack. The caller's information is then extracted from this stack.
You should dig this way. But you better should not log this. Use Stacks/Properties instead to localize logging point in the source. It may not be as accurate as StackTrace but it is appropriate and reliable. On Tue, May 4, 2010 at 5:50 PM, ITemplate <[email protected]> wrote: > > Hi, > > Using a file appender, I can write the source code line number in my log > file using "%line". But if I have a custom Appender with the "LoggingEvent" > - where is that information stored and retrievable? > > -- > Werner > -- > View this message in context: > http://old.nabble.com/How-to-get-line-number-and-file-name-in-custom-Appender--tp28447536p28447536.html > Sent from the Log4net - Users mailing list archive at Nabble.com. > >
