[
https://issues.apache.org/jira/browse/LOG4NET-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710413#action_12710413
]
Lars Corneliussen commented on LOG4NET-154:
-------------------------------------------
Hi,
I'm writing a similar piece of code right now, and I got some comments:
1) stackFrame.GetMethod().DeclaringType fails for dynamic methods.
2) I think the stacktrace ist mostly only interesting when no exceptionobject
including stacktrace is logged. The default behaviour could be, to not log the
stacktrace in that case.
3) Since stacktrace is expensive and often interesting for certain levels, a
option to set a level-threshold would be great.
4) The level of detail is to little.
Example: %message%exception%stacktrace{threshold:WARN}
As %exception does, %stacktrace could write one line per frame and end with a
line break.
My current stacktrace format is:
[#7] ERROR - c3ad8e6f-3c70-4e7d-840c-2f92854445bc -
[DLR.CoMet.Test.Api.Utils.LoggingTest (null) 2009-05-18 19:31:43,155]
at When_logging_error_messages.Error_ShouldLogToDefaultAndDevException() :
Void in
C:\Workbench\DLR\trunk\Diensteverwaltung\src\Test.Components\Api\Utils\LoggingTests\When_logging_error_messages.cs:29:13
It includes generic type- and method-parameters.
> Add a StackTracePatternConverter to display method calls leading up to log
> message
> ----------------------------------------------------------------------------------
>
> Key: LOG4NET-154
> URL: https://issues.apache.org/jira/browse/LOG4NET-154
> Project: Log4net
> Issue Type: New Feature
> Reporter: Ron Grabowski
> Fix For: 1.2.11
>
> Attachments: StackTracePatternConverter.zip
>
>
> Modify LocationInfo to save StackTrace information and make it available as
> StackTracePatternConverter to display call stack leading up to the log
> message:
> log.Debug("Item Saved");
>
> [%stackTrace{3}] %message%newline
> [default_aspx.btnSubmit_Click > productController.Save >
> productService.Save] Item Saved
> This will probably be a slow pattern converter on par with other LocationInfo
> derived pattern converters.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.