Skip to content

Add tests for regression in file rolling and fix bug #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gdziadkiewicz
Copy link
Contributor

@gdziadkiewicz gdziadkiewicz commented Jun 15, 2025

Fixes #250

Problem

It is easy to break someone's legitimate Log4net configuration or not account for .NET version quirks while making changes to the rolling appended.

Idea

Gather all of the configurations we gathered in bug reports, plus variations that make sense for us, and use them as test cases against regression.

Remember:

  • to run on both .NET and .NET Framework (this is free, we are running on net8 and net462 :) )
  • to include both approaches of providing file extension -> in the file and the date field ( done thanks to the no_name test)
  • to test rolling during one "long" run (added one with timeout)
  • to test behaviour on restart ( v3.1.0 is breaking rolling logfiles usage #250 manifests during restart) (done)
  • add comments explaining used configs

TODO:

  • Fix paths on Linux and macOS
  • Add comments
  • Cleanup style

@gdziadkiewicz gdziadkiewicz changed the title Add draft of tests for file rolling regression Add tests for regression in file rolling and fix bug Jun 15, 2025

directory = Path.GetDirectoryName(fullPath);
if (Directory.Exists(directory))
{
string baseFileName = Path.GetFileName(fullPath);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to clean that whitespace change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@gdziadkiewicz gdziadkiewicz force-pushed the Fix_#250_and_add_tests_agains_regression_in_file_roll branch from 48ef9aa to d77af80 Compare June 25, 2025 07:13
@gdziadkiewicz gdziadkiewicz force-pushed the Fix_#250_and_add_tests_agains_regression_in_file_roll branch from b5db4fe to 783b998 Compare June 25, 2025 17:12
@gdziadkiewicz gdziadkiewicz force-pushed the Fix_#250_and_add_tests_agains_regression_in_file_roll branch from 783b998 to 6f9363c Compare June 28, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v3.1.0 is breaking rolling logfiles usage
2 participants