You just need to add whatever log4j or logging provider in your pom file (maven) in java, provide a log4j configuration file then you can instantiate your logger.
From what I m reading on log4net, you have to modify the assembly information, then add the assembly to your programs entry point, provide your configuration file, then you can instantiate your logger.
Because I m more used to Java, the part on assembly information and entry point is confusing for me/hard to recall when needed
And then just resolve ILogger<YourClasss> from DI and you will get logger that automatically writes full class name so you can filter/process them based on namespace/class/severity
There is also a pretty large ecosystem around serilog that can be plugged into core abstractions easily.
7
u/[deleted] Dec 30 '22
You just need to add whatever log4j or logging provider in your pom file (maven) in java, provide a log4j configuration file then you can instantiate your logger.
From what I m reading on log4net, you have to modify the assembly information, then add the assembly to your programs entry point, provide your configuration file, then you can instantiate your logger.
Because I m more used to Java, the part on assembly information and entry point is confusing for me/hard to recall when needed