I'm using docker so I would like to be able to change the logging level in program based on the environment variables in docker-compose. It was easily implementable in Java programs using logback-spring.xml
<variable name="LOG_LEVEL" value="${LOG_LEVEL:-TRACE}" />
<root level="${LOG_LEVEL}">
<appender-ref ref="RollingFile" />
<appender-ref ref="Console" />
</root>
But I seem to be unable to achieve the same in .net (Core 2.1).
At the moment - I got this:
<log4net>
<root>
<level value="%env{LOG_LEVEL:INFO}" />
<appender-ref ref="all" />
<appender-ref ref="ConsoleAppender"/>
</root>
...
...
Which is the closest I seem to be able to come to the "correct answer" based on documentation, but I just get log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [LOG_LEVEL] to set object on [log4net.Repository.Hierarchy.Hierarchy]
Older documentation (couldn't pin point the same place in new one) seems to show that syntax should be correct. The guy with a similar situation I managed to find - had the same issue.
Any ideas would help