Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-429

Pattern with Context property causes severe slowdown

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.13
    • Fix Version/s: None
    • Component/s: Core
    • Labels:

      Description

      If you use a context property in your appenders pattern, there will be a significant logging slowdown. In my experience anywhere from 3 to 5 times slower (this will depend on the appender).

      I believe that as soon as you use a context property log4net will internally access the windows user name even though it's not the property you want to access. This theory comes from the fact that printing all properties in the pattern (including the costly property username) compared to just printing one will slow down the logging with the same factor.

      I've made a stackoverflow question with more details as well

      http://stackoverflow.com/questions/22612286/using-log4net-context-properties-has-negative-impact-on-performance/

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              nachbarslumpi Dominik Psenner
              Reporter:
              ds99jove Jonas Versén

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 40m
                1h 40m

                  Issue deployment