[ 
https://issues.apache.org/jira/browse/LOG4NET-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12774694#action_12774694
 ] 

Adam Davies commented on LOG4NET-154:
-------------------------------------

I have further extended the functionality of the StackTracePatternConverter to 
allow the selection of min / max frames.

Given: %message%exception%stacktrace{MAX|MIN}

Explantion: {MAX|MIN}
      The MAX controls how deep to display the stacktrace.  MAX displays the 
first n of the stacktrace from the top item 
          (stacktrace[0] to stacktrace[n])
          Any int >= 0 will only allow the first x 
      The MIN is optional.  MIN sets the number of stacktrace items to skip 
from stacktrace[0]
          If MIN is greater than the number of stacktrace items, then no 
stacktrace will be displayed.

 Example: %stacktrace{3}, displays       stacktrace[2] > stacktrace[1] > 
stacktrace[0]
 Example: %stacktrace{5}, displays       stacktrace[4] > stacktrace[3] > 
stacktrace[2] > stacktrace[1] > stacktrace[0]
 Example: %stacktrace{3|1}, displays       stacktrace[2] > stacktrace[1] 
 Example: %stacktrace{-1}, displays       stacktrace[n] > stacktrace[n-1] > ... 
> stacktrace[1] > stacktrace[0]
 Example: %stacktrace{-1|3}, displays       stacktrace[n] > stacktrace[n-1] > 
... > stacktrace[4] > stacktrace[3]


In addition I have created a new pattern StackTraceDetailPatternConverter.  
This pattern inherits from StackTracePatternConverter, and provides parameter 
information for each method.

Given: %message%exception%stacktracedetail{MAX|MIN}

 Example: %stacktrace{3}, displays       stacktrace[2](type param, ...) > 
stacktrace[1](type param, ...) > stacktrace[0](type param, ...)
 Example: %stacktrace{3|1}, displays       stacktrace[2](type param, ...) > 
stacktrace[1](type param, ...)

> 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.

Reply via email to