Skip to content

Commit 9d7c1cb

Browse files
authored
Merge pull request #174 from apache/Feature/173-Dropping-legacy-serialization-support
dropping legacy serialization support
2 parents 1ae2803 + b7cb391 commit 9d7c1cb

30 files changed

+99
-951
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ ENV PATH="$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools"
3232

3333
ADD . /logging-log4net
3434
RUN dotnet restore /logging-log4net/src/log4net.sln
35-
RUN dotnet build /logging-log4net/src/log4net.sln
36-
CMD /bin/bash
35+
RUN dotnet build -c Release /logging-log4net/src/log4net.sln
36+
CMD ["/bin/bash"]

doc/RELEASING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ release version 2.0.123:
3131
- log4net.build: update package.version property
3232
- pom.xml: update version
3333
4. Sign release artifacts (zips & nupkg) under `build/artifacts`
34-
- eg `gpg --argmor --output log4net-2.0.123.nupkg.asc --detach-sig log4net-2.0.123.nupkg`
34+
- eg `gpg --armor --output log4net-2.0.123.nupkg.asc --detach-sig log4net-2.0.123.nupkg`
3535
- there is an accompanying `sign-log4net-libraries.sh` which you could invoke if you cd
3636
into the `build/artifacts` folder
3737
- I build on Windows and sign on Linux as my build machine belongs to my company

log4net.snk.readme

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,11 @@ Apache log4net Strong Name Key Readme
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

44
The log4net release builds are strongly named using the log4net.snk key
5-
file. This key is different from the key used to sign log4net 1.2.10
6-
and earlier releases.
7-
8-
Starting with log4net 1.2.11 we've decided to use a key that we don't
5+
file. Starting with log4net 1.2.11 we've decided to use a key that we don't
96
keep secret so you can build a drop-in replacement for an official
10-
release yourself. This means that the strong name of a log4net
7+
release yourself. This means that the strong name of a log4net
118
assembly no longer provides any means of checking its authenticity.
129
The only way to ensure you are using an official release by the Apache
1310
Software Foundation is by downloading the distribution from the Apache
1411
log4net download page and verifying the PGP signature of the ZIP
15-
archive.
16-
17-
The key used to sign those older releases is not and has never been
18-
distributed as part of the log4net source or binary downloads.
19-
20-
In order to make it easier to migrate from log4net 1.2.10 to newer
21-
releases log4net 1.2.11 we also provide builds using the key used to
22-
sign 1.2.10. We may stop distributing these alternative builds in the
23-
future.
24-
25-
You should use the binary builds signed with log4net.snk for new
26-
projects and only use the ones signed with "the old key" if switching
27-
to the newer builds is not possible because other parts of your
28-
project depend on the old strong name.
12+
archive.

src/MonoForFramework.targets

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/lib/mono')">/usr/lib/mono</BaseFrameworkPathOverrideForMono>
88
<BaseFrameworkPathOverrideForMono Condition="'$(BaseFrameworkPathOverrideForMono)' == '' AND EXISTS('/usr/local/lib/mono')">/usr/local/lib/mono</BaseFrameworkPathOverrideForMono>
99
<!-- If we found Mono reference assemblies, then use them -->
10-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net20'">$(BaseFrameworkPathOverrideForMono)/2.0-api</FrameworkPathOverride>
11-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net35'">$(BaseFrameworkPathOverrideForMono)/3.5-api</FrameworkPathOverride>
12-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net40'">$(BaseFrameworkPathOverrideForMono)/4.0-api</FrameworkPathOverride>
13-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net45'">$(BaseFrameworkPathOverrideForMono)/4.5-api</FrameworkPathOverride>
14-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net451'">$(BaseFrameworkPathOverrideForMono)/4.5.1-api</FrameworkPathOverride>
15-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net452'">$(BaseFrameworkPathOverrideForMono)/4.5.2-api</FrameworkPathOverride>
16-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net46'">$(BaseFrameworkPathOverrideForMono)/4.6-api</FrameworkPathOverride>
17-
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net461'">$(BaseFrameworkPathOverrideForMono)/4.6.1-api</FrameworkPathOverride>
1810
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net462'">$(BaseFrameworkPathOverrideForMono)/4.6.2-api</FrameworkPathOverride>
1911
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net47'">$(BaseFrameworkPathOverrideForMono)/4.7-api</FrameworkPathOverride>
2012
<FrameworkPathOverride Condition="'$(BaseFrameworkPathOverrideForMono)' != '' AND '$(TargetFramework)' == 'net471'">$(BaseFrameworkPathOverrideForMono)/4.7.1-api</FrameworkPathOverride>

src/build-preview.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dotnet build -c Release '-p:GeneratePackages=true;VersionSuffix=preview.3' ./log4net/log4net.csproj
1+
dotnet build -c Release '-p:GeneratePackages=true;VersionSuffix=preview.4' ./log4net/log4net.csproj

src/changes/changes.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/log4net.Tests/Appender/RollingFileAppenderTest.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,7 @@ private static void AssertFileEquals(string filename, string contents)
13791379
[Test]
13801380
public void TestLogOutput()
13811381
{
1382+
Utils.InconclusiveOnMono();
13821383
string filename = "test_simple.log";
13831384
SilentErrorHandler sh = new();
13841385
ILogger log = CreateLogger(filename, new FileAppender.ExclusiveLock(), sh);
@@ -1419,6 +1420,7 @@ public void TestExclusiveLockFails()
14191420
[Test]
14201421
public void TestExclusiveLockRecovers()
14211422
{
1423+
Utils.InconclusiveOnMono();
14221424
string filename = "test_exclusive_lock_recovers.log";
14231425

14241426
FileStream fs = new(filename, FileMode.Create, FileAccess.Write, FileShare.None);
@@ -1442,6 +1444,7 @@ public void TestExclusiveLockRecovers()
14421444
[Test]
14431445
public void TestExclusiveLockLocks()
14441446
{
1447+
Utils.InconclusiveOnMono();
14451448
string filename = "test_exclusive_lock_locks.log";
14461449
bool locked = false;
14471450

@@ -1458,7 +1461,7 @@ public void TestExclusiveLockLocks()
14581461
catch (IOException e1)
14591462
{
14601463
Assert.AreEqual("The process cannot access the file ", e1.Message.Substring(0, 35),
1461-
"Unexpected exception");
1464+
"Unexpected exception");
14621465
locked = true;
14631466
}
14641467

@@ -1478,6 +1481,7 @@ public void TestExclusiveLockLocks()
14781481
[Test]
14791482
public void TestMinimalLockFails()
14801483
{
1484+
Utils.InconclusiveOnMono();
14811485
string filename = "test_minimal_lock_fails.log";
14821486

14831487
FileStream fs = new(filename, FileMode.Create, FileAccess.Write, FileShare.None);
@@ -1501,6 +1505,7 @@ public void TestMinimalLockFails()
15011505
[Test]
15021506
public void TestMinimalLockRecovers()
15031507
{
1508+
Utils.InconclusiveOnMono();
15041509
string filename = "test_minimal_lock_recovers.log";
15051510

15061511
FileStream fs = new(filename, FileMode.Create, FileAccess.Write, FileShare.None);
@@ -1524,6 +1529,7 @@ public void TestMinimalLockRecovers()
15241529
[Test]
15251530
public void TestMinimalLockUnlocks()
15261531
{
1532+
Utils.InconclusiveOnMono();
15271533
string filename = "test_minimal_lock_unlocks.log";
15281534
bool locked;
15291535

@@ -1552,6 +1558,7 @@ public void TestMinimalLockUnlocks()
15521558
[Test]
15531559
public void TestInterProcessLockFails()
15541560
{
1561+
Utils.InconclusiveOnMono();
15551562
string filename = "test_interprocess_lock_fails.log";
15561563

15571564
FileStream fs = new(filename, FileMode.Create, FileAccess.Write, FileShare.None);
@@ -1575,6 +1582,7 @@ public void TestInterProcessLockFails()
15751582
[Test]
15761583
public void TestInterProcessLockRecovers()
15771584
{
1585+
Utils.InconclusiveOnMono();
15781586
string filename = "test_interprocess_lock_recovers.log";
15791587

15801588
FileStream fs = new(filename, FileMode.Create, FileAccess.Write, FileShare.None);
@@ -1598,6 +1606,7 @@ public void TestInterProcessLockRecovers()
15981606
[Test]
15991607
public void TestInterProcessLockUnlocks()
16001608
{
1609+
Utils.InconclusiveOnMono();
16011610
string filename = "test_interprocess_lock_unlocks.log";
16021611
bool locked;
16031612

@@ -1626,6 +1635,7 @@ public void TestInterProcessLockUnlocks()
16261635
[Test]
16271636
public void TestInterProcessLockRoll()
16281637
{
1638+
Utils.InconclusiveOnMono();
16291639
const string filename = "test_interprocess_lock_roll.log";
16301640

16311641
SilentErrorHandler sh = new();

src/log4net.Tests/Appender/SmtpPickupDirAppenderTest.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ private static void DestroyLogger()
170170
[Test]
171171
public void TestOutputContainsSentDate()
172172
{
173+
Utils.InconclusiveOnMono();
173174
SilentErrorHandler sh = new SilentErrorHandler();
174175
SmtpPickupDirAppender appender = CreateSmtpPickupDirAppender(sh);
175176
ILogger log = CreateLogger(appender);
@@ -203,6 +204,7 @@ public void TestOutputContainsSentDate()
203204
[Test]
204205
public void TestConfigurableFileExtension()
205206
{
207+
Utils.InconclusiveOnMono();
206208
const string fileExtension = "eml";
207209
SilentErrorHandler sh = new SilentErrorHandler();
208210
SmtpPickupDirAppender appender = CreateSmtpPickupDirAppender(sh);
@@ -226,6 +228,7 @@ public void TestConfigurableFileExtension()
226228
[Test]
227229
public void TestDefaultFileNameIsAGuid()
228230
{
231+
Utils.InconclusiveOnMono();
229232
SilentErrorHandler sh = new SilentErrorHandler();
230233
SmtpPickupDirAppender appender = CreateSmtpPickupDirAppender(sh);
231234
ILogger log = CreateLogger(appender);

src/log4net.Tests/Core/LoggingEventTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ private static readonly DateTime localTime
3939
[Test]
4040
public void SerializeDeserialize_BinaryFormatter()
4141
{
42+
Utils.InconclusiveOnMono();
4243
var timestamp = localTime.ToUniversalTime();
4344
var ev = new LoggingEvent(new LoggingEventData
4445
{
@@ -87,6 +88,7 @@ public void SerializeDeserialize_BinaryFormatter()
8788
[Test]
8889
public void DeserializeV2()
8990
{
91+
Utils.InconclusiveOnMono();
9092
const string datPath = @"..\..\..\..\integration-testing\log4net2-SerializeEvent\SerializeV2Event.dat";
9193
using var stream = File.OpenRead(datPath);
9294
var formatter = new BinaryFormatter();

src/log4net.Tests/Utils.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,40 @@
1717
//
1818
#endregion
1919

20+
using System;
21+
using NUnit.Framework;
22+
2023
namespace log4net.Tests
2124
{
2225
/// <summary>
23-
/// Summary description for Class1.
26+
/// Utilities for testing
2427
/// </summary>
2528
public static class Utils
2629
{
30+
/// <summary>
31+
/// Is the mono runtime used
32+
/// </summary>
33+
internal static bool IsMono { get; } = Type.GetType("Mono.Runtime") is not null;
34+
35+
/// <summary>
36+
/// Skips the current test when run under mono
37+
/// </summary>
38+
internal static void InconclusiveOnMono()
39+
{
40+
if (IsMono)
41+
{
42+
Assert.Inconclusive("mono has a different behaviour");
43+
}
44+
}
45+
46+
/// <summary>
47+
/// Sample property key
48+
/// </summary>
2749
internal const string PROPERTY_KEY = "prop1";
2850

51+
/// <summary>
52+
/// Remove the <see cref="PROPERTY_KEY"/> from alle log4net contexts
53+
/// </summary>
2954
internal static void RemovePropertyFromAllContexts()
3055
{
3156
GlobalContext.Properties.Remove(PROPERTY_KEY);

0 commit comments

Comments
 (0)