Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions doc/MailTemplate.Announce.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
To: announce@apache.org, dev@logging.apache.org
Subject: [ANNOUNCE] Apache log4net 3.4.1 released
Subject: [ANNOUNCE] Apache log4net 3.5.0 released

Hi,

the Apache log4net team is pleased to announce the 3.4.1 release.
the Apache log4net team is pleased to announce the 3.5.0 release.

For further information (support, download, etc.) see

- https://logging.apache.org/log4net/release-notes.html
- https://github.com/apache/logging-log4net/releases/tag/rel%2F3.4.1
- https://www.nuget.org/packages/log4net/3.4.1
- https://www.nuget.org/packages/log4net.Ext.Mail/3.4.1
- https://github.com/apache/logging-log4net/releases/tag/rel%2F3.5.0
- https://www.nuget.org/packages/log4net/3.5.0
- https://www.nuget.org/packages/log4net.Ext.Mail/3.5.0

Highlights of this release:

Expand Down
4 changes: 2 additions & 2 deletions doc/MailTemplate.Result.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
To: dev@logging.apache.org
Subject: [RESULT][VOTE] Release Apache Log4net 3.4.1
Subject: [RESULT][VOTE] Release Apache Log4net 3.5.0

and here is my +1.

Expand All @@ -9,6 +9,6 @@ I will continue the release process.
Jan

---------------------------------------------------------------------------------------------------
This is a vote to release the Apache Log4net 3.4.1.
This is a vote to release the Apache Log4net 3.5.0.

...
6 changes: 3 additions & 3 deletions doc/MailTemplate.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
To: dev@logging.apache.org
Subject: [VOTE] Release Apache Log4net 3.4.1
Subject: [VOTE] Release Apache Log4net 3.5.0

This is a vote to release the Apache Log4net 3.4.1.
This is a vote to release the Apache Log4net 3.5.0.

Website: https://logging.staged.apache.org/log4net/release-notes.html
GitHub: https://github.com/apache/logging-log4net
Commit: <todo>
Distribution: https://dist.apache.org/repos/dist/dev/logging/log4net/3.4.1
Distribution: https://dist.apache.org/repos/dist/dev/logging/log4net/3.5.0
Signing key: 0x7D24496A230E29D6349A99EF583E491578F02D5D
Review kit: https://logging.staged.apache.org/log4net/release-review.html

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "log4net",
"version": "3.4.1",
"version": "3.5.0",
"description": "Log4Net is a logging framework for .NET",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<packaging>pom</packaging>
<groupId>org.apache.logging.log4net</groupId>
<artifactId>apache-log4net</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<name>Apache log4net</name>
<description>Logging framework for Microsoft .NET Framework.</description>
<url>https://logging.apache.org/log4net</url>
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-preview.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Requires -Version 7.4

param(
$Version = '3.4.1',
$Version = '3.5.0',
$Preview = '1'
)

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-release.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#Requires -Version 7.4

param(
$Version = '3.4.1'
$Version = '3.5.0'
)

Set-StrictMode -Version Latest
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<VersionPrefix>3.4.1</VersionPrefix>
<VersionPrefix>3.5.0</VersionPrefix>
<Log4NetPackageVersion>3.4.0</Log4NetPackageVersion>
<MailKitPackageVersion>4.17.0</MailKitPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>4.5.0</SystemConfigurationConfigurationManagerPackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<release xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
date="2026-10-20"
version="3.4.1"/>
date="2026-11-01"
version="3.5.0"/>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
`$PSNativeCommandUseErrorActionPreference`, which exists only from 7.4, so under Windows PowerShell
5.1 a failing `gpg --verify` was ignored and `verify-release.ps1` reported success and exited 0. The
scripts now refuse to start on an older host, and the review instructions install PowerShell 7 and
run the script with `pwsh` (audit da18b6fd-f004)
run the script with `pwsh` (audit 1231d72-f009)
</description>
</entry>
14 changes: 14 additions & 0 deletions src/changelog/3.5.0/314-adonet-retry-cap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
stop `AdoNetAppender` from retrying a whole batch one event at a time when none of them can be
written. Retrying after a rolled back transaction was added in 3.4.0 to save the events around
the one the database rejected, but a batch that fails outright, such as a missing table or a
missing permission, then cost one round trip per event: 513 instead of 1 for a full buffer. It
now gives up after five consecutive failures (implemented by @FreeAndNil)
</description>
</entry>
15 changes: 15 additions & 0 deletions src/changelog/3.5.0/314-ext-mail-background-sender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="changed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
send mail from a background thread in the MailKit based `SmtpAppender`. The mail used to go out
while the appender lock was held, so the thread that logged, and every thread behind it, waited
for the SMTP server. The queue holds `sendQueueSize` mails (500) and a logging call waits at most
`enqueueTimeoutMillis` (5000) for room in it. Failures are still reported to the error handler,
but after the logging call has returned, and `Flush` now honours its timeout
(implemented by @FreeAndNil)
</description>
</entry>
14 changes: 14 additions & 0 deletions src/changelog/3.5.0/314-ext-mail-send-timeout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="changed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
bound a whole send in the MailKit based `SmtpAppender` to 15 seconds. MailKit waits 100 seconds
per operation by default, and the mail goes out while the appender lock is held, so an
unresponsive server suspended every thread logging through the appender. `SendTimeoutMillis` is a
deadline for the send as a whole, because a per operation timeout still allows a multiple of
itself overall (implemented by @FreeAndNil)
</description>
</entry>
12 changes: 12 additions & 0 deletions src/changelog/3.5.0/314-flush-reports-buffered-events.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
report a buffering appender that is still holding events from `Flush`. It returned `true`
unconditionally, including for a `lossy` appender, where flushing deliberately does nothing and
every buffered event stays where it was (implemented by @FreeAndNil)
</description>
</entry>
14 changes: 14 additions & 0 deletions src/changelog/3.5.0/314-remote-syslog-background-sender.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
bound the queue `RemoteSyslogAppender` sends from. It was unbounded, so a syslog server that
stopped accepting datagrams grew it until the process ran out of memory, and shutdown waited five
seconds and then abandoned a drain that had no limit of its own. It now holds `sendQueueSize`
datagrams (500), a logging call waits at most `enqueueTimeoutMillis` (5000) for room, losses are
counted and reported, and `Flush` honours its timeout (implemented by @FreeAndNil)
</description>
</entry>
14 changes: 14 additions & 0 deletions src/changelog/3.5.0/314-remote-syslog-socket-and-connect.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="fixed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
stop `RemoteSyslogAppender` from opening a second, unused UDP socket. It sends through the
connection its background pump owns, but also inherited one from `UdpAppender` that nothing ever
used, which bound `localPort` twice. A pump that cannot connect now reports it as well, instead
of ending unobserved and leaving every later event queued behind a sender that is gone
(implemented by @FreeAndNil)
</description>
</entry>
13 changes: 13 additions & 0 deletions src/changelog/3.5.0/314-smtpappender-send-timeout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://logging.apache.org/xml/ns"
xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-changelog-0.xsd"
type="changed">
<issue id="314" link="https://github.com/apache/logging-log4net/pull/314"/>
<description format="asciidoc">
bound a single send in `SmtpAppender` to 15 seconds. `SmtpClient.Timeout` defaults to 100
seconds and the appender never set it, and the mail goes out while the appender lock is held, so
a server that accepted the connection and then stopped answering suspended every thread logging
through the appender. Configurable with `SendTimeoutMillis` (implemented by @FreeAndNil)
</description>
</entry>
29 changes: 25 additions & 4 deletions src/log4net.Ext.Mail.Tests/Appender/FakeSmtpTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Text;

using log4net.Ext.Mail.Appender.Internal;
Expand Down Expand Up @@ -67,36 +68,46 @@ internal sealed class FakeSmtpTransport : ISmtpTransport
/// </summary>
internal Exception? SendException { get; set; }

/// <summary>When set, every call that takes a token waits this long, honouring it.</summary>
internal int DelayMillisPerCall { get; set; }

public int Timeout { get; set; }

public bool IsConnected { get; private set; }

public bool IsAuthenticated { get; private set; }

public void Connect(string host, int port, SecureSocketOptions secureSocketOptions)
public void Connect(string host, int port, SecureSocketOptions secureSocketOptions,
CancellationToken cancellationToken)
{
Calls.Add(nameof(Connect));
Delay(cancellationToken);
ConnectedHost = host;
ConnectedPort = port;
SecureSocketOptions = secureSocketOptions;
IsConnected = true;
}

public void Authenticate(ICredentials credentials)
public void Authenticate(ICredentials credentials, CancellationToken cancellationToken)
{
Calls.Add(nameof(Authenticate));
Delay(cancellationToken);
Credentials = credentials;
IsAuthenticated = true;
}

public void Authenticate(SaslMechanism mechanism)
public void Authenticate(SaslMechanism mechanism, CancellationToken cancellationToken)
{
Calls.Add(nameof(Authenticate));
Delay(cancellationToken);
SaslMechanism = mechanism;
IsAuthenticated = true;
}

public void Send(MimeMessage message)
public void Send(MimeMessage message, CancellationToken cancellationToken)
{
Calls.Add(nameof(Send));
Delay(cancellationToken);
if (SendException is Exception exception)
{
throw exception;
Expand All @@ -116,6 +127,16 @@ public void Dispose()
Calls.Add(nameof(Dispose));
IsDisposed = true;
}

private void Delay(CancellationToken cancellationToken)
{
if (DelayMillisPerCall > 0)
{
cancellationToken.WaitHandle.WaitOne(DelayMillisPerCall);
}

cancellationToken.ThrowIfCancellationRequested();
}
}

/// <summary>
Expand Down
Loading
Loading