When you use Log4net you're best adding a separate config file specifically for log4net.
This is a different file in addition to any app.config you may be using.
You can technically use a json file for config and you might be able to add a section to app.config. I never tried the latter.
Don't do either of those.
There are a huge and bewildering load of different settings and you're best keeping things simple.
That's not the only reason I work this way though.
This approach will also work for all options. When I do asp.net core or a console app or anything else then I'm using the same option.
In any case, leave complications for later once you get it working.
You add the log4net nuget package ( which I gather you've done ).
That gives you the dll and references them.
Nothing will happen if that's all you do though.
Because it's the config file tells it what to do with what log levels and nothing will happen until log4net in the exe reads those settings.
You then add a log4net.config file.
This must go in the root folder of your entry point project.
That's so it will end up in your bin folder next to the exe.
There are a bunch of example configs out there on the internet you could copy.
Here's one.
If you just add that config file to your project then nothing will work because when you compile and run the exe won't find that file on disk where it's looking.
You need to get the build process to copy that file.
The way you do that is to set 2 properties on it.
Select the file in solution explorer.
With a default visual studio set up, beneath solution explorer you have properties.
Set Build Action: Content Copy to output Directory: Copy if newer.
Build your project.
Go look in your bin and find your compiled exe.
Next to it should be a copy of your new config file.
So long as your code writing log entries is good and the folders that config file references are accessible then it should work.
EDIT:
If it still doesn't find the config then tell it explicitly which config file to go read. You do that by adding the following line:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config")]
To your assemblyinfo.cs file.
That's under properties in a net core app.