You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by fr...@apache.org on 2026/09/23 18:19:17 UTC

(logging-log4net) branch master updated (781b4a86 -> fcdfc78d)

This is an automated email from the ASF dual-hosted git repository.

FreeAndNil pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git


    from 781b4a86 close the outgoing appenders before activating the new ones #321 - #322
     add 2aa63611 point %property at the path traversal FAQ #323
     add a2f7c25c say that the ASP.NET trace appender is request scoped #323
     add 21c144ad stop a disposed logical stack frame restoring removed frames #323
     add 872ca000 deprecate TwoArgAction #323
     add e7259661 unlock the event cache only while fixing #323
     new fcdfc78d stop stale context reaching logical stacks and fixed events #323

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changelog/3.5.0/323-deprecate-twoargaction.xml | 11 ++++
 .../3.5.0/323-logging-event-fix-cache.xml          | 13 ++++
 src/changelog/3.5.0/323-logical-stack-dispose.xml  | 12 ++++
 .../Context/LogicalThreadContextTest.cs            | 72 ++++++++++++++++++++++
 src/log4net.Tests/Core/FixingTest.cs               | 41 ++++++++++++
 src/log4net/Appender/AspNetTraceAppender.cs        |  3 +
 src/log4net/Core/LoggingEvent.cs                   | 10 ++-
 src/log4net/Util/LogicalThreadContextStack.cs      | 52 +++++++++-------
 src/log4net/Util/LogicalThreadContextStacks.cs     | 15 ++++-
 .../PropertyPatternConverter.cs                    |  2 +
 .../ROOT/pages/manual/configuration/appenders.adoc |  2 +
 src/site/antora/modules/ROOT/pages/manual/faq.adoc |  2 +
 12 files changed, 203 insertions(+), 32 deletions(-)
 create mode 100644 src/changelog/3.5.0/323-deprecate-twoargaction.xml
 create mode 100644 src/changelog/3.5.0/323-logging-event-fix-cache.xml
 create mode 100644 src/changelog/3.5.0/323-logical-stack-dispose.xml


(logging-log4net) 01/01: stop stale context reaching logical stacks and fixed events #323

Posted by fr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

FreeAndNil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git

commit fcdfc78dea342edc5e2ea93953104a738d3a11c5
Merge: 781b4a86 e7259661
Author: Jan Friedrich <43...@users.noreply.github.com>
AuthorDate: Wed Sep 23 20:19:12 2026 +0200

    stop stale context reaching logical stacks and fixed events #323
    
    ## Fixed
    
    - **Logical stack brought back old frames**, audit da18b6fd-f044
      - `Dispose` used the copy of the stack made at `Push` time
      - after `Clear`, or after two `Pop` calls, the old frames came back
      - it now cuts the stack that is in use and never adds to it
      - known limit: disposing a frame of another flow cuts this flow, so frames can be lost, but
        nothing is added
    - **A second `Fix` opened the event cache again**, audit da18b6fd-f039
      - the cache was opened before we knew if there was anything to fix
      - another thread could then write its own identity, thread name or location into the event
      - before the fix: one hit after 56000 to 63000 calls, five runs of five. After: none in 2000000
    
    ## Deprecated
    
    - `log4net.Util.TwoArgAction`, the old callback of the stack, now unused, to be removed in v4
    
    ## Documented, not changed
    
    - **`%property` in a `PatternString`-typed setting**, audit da18b6fd-f021
      - a path built from such a value is the operator's choice, see the model and the FAQ on path
        traversal
      - cleaning the value in the converter would change it everywhere, and in the wrong place
    - **`AspNetTraceAppender` belongs to one request**, audit da18b6fd-f006
      - behind a buffering appender, a flush writes into the request that caused it
      - dropping older events instead would lose them, which is worse
    
    ## Speed of the stack change
    
    1M calls, best of 5, Release on net10.0:
    
    | case | before | after |
    |---|---|---|
    | push and dispose, depth 1 | 405 to 438 ns, 1272 B | 412 to 458 ns, 1272 B |
    | push and dispose, depth 3 | 1386 to 1433 ns, 3976 B | 1414 to 1440 ns, 3976 B |
    | dispose after Clear | 548 ns, 1656 B | 361 ns, 1016 B |
    
    The normal cases are the same within noise and use the same memory. The fixed case is 34 percent
    faster.

 src/changelog/3.5.0/323-deprecate-twoargaction.xml | 11 ++++
 .../3.5.0/323-logging-event-fix-cache.xml          | 13 ++++
 src/changelog/3.5.0/323-logical-stack-dispose.xml  | 12 ++++
 .../Context/LogicalThreadContextTest.cs            | 72 ++++++++++++++++++++++
 src/log4net.Tests/Core/FixingTest.cs               | 41 ++++++++++++
 src/log4net/Appender/AspNetTraceAppender.cs        |  3 +
 src/log4net/Core/LoggingEvent.cs                   | 10 ++-
 src/log4net/Util/LogicalThreadContextStack.cs      | 52 +++++++++-------
 src/log4net/Util/LogicalThreadContextStacks.cs     | 15 ++++-
 .../PropertyPatternConverter.cs                    |  2 +
 .../ROOT/pages/manual/configuration/appenders.adoc |  2 +
 src/site/antora/modules/ROOT/pages/manual/faq.adoc |  2 +
 12 files changed, 203 insertions(+), 32 deletions(-)